Hello I am trying to create 2 tables one with users wich is already working and one with Roles
View: the bottom table is working well, only the "applicationRoles" is not
Application Role:
- public class ApplicationRole : IdentityRole<Guid>
- {
- public string Description { get; set; }
- }
viewmodel:
- public class AdminDetailsViewModel
- {
- public List<ApplicationUser> application { get; set; }
- public List<ApplicationRole> applicationRoles { get; set; }
- }
Controller:
- public async Task<IActionResult> Index()
- {
-
- var app = from m in _context.Users
- select m;
-
- var approle = from m in _context.UserRoles
- select m;
-
- var Admininfo = new AdminDetailsViewModel
- {
-
- application = await app.ToListAsync(),
- applicationRoles = await approle.ToListAsync() // I get a error here
- };
-
- return View(Admininfo);
- }
Im not really sure how i should handle this