0

I want to get the UserName from identity and associate it to his Id as foreign key from another table. I know I have to do an inner join, but I don't really know how I can do this using Razor, hope someone can help me

Code:

var users = UserManager.Users.ToList();

ViewBag.Users = new SelectList(db.Users_Groups.Where(o => o.IdGroup == id), "IdUser", /*Username here */);

DB: enter image description here

Balázs
  • 2,929
  • 2
  • 19
  • 34
Dr. Roggia
  • 1,095
  • 3
  • 16
  • 40
  • Could you please clear up what you want to join with what and what values you want to extract from the results? It is not really clear from your phrasing. – Balázs Feb 02 '17 at 12:02
  • Have a look here: http://stackoverflow.com/a/21051754/809357 – trailmax Feb 02 '17 at 13:31

0 Answers0