This is my applicationDbContext class:
public class ApplicationDbContext : IdentityDbContext<ApplicationUser, CustomRole,
int, CustomUserLogin, CustomUserRole, CustomUserClaim>
and this is my controller action method to retreive all the users with their user name:
public JsonResult GetUsers()
{
var ret = (from user in db.Users
orderby user.Id
select new
{
UserName = user.UserName,
}).AsEnumerable();
return Json(ret, JsonRequestBehavior.AllowGet);
}
Now, i am running into a problem.Whenever i execute, i got this problem----Multiple object sets per type are not supported. The object sets 'ApplicationUsers' and 'Users' can both contain instances of type 'App.Models.ApplicationUser'.
I have seen this so questions How to obtain a list of Users from ASP.NET Identity?. What is the simplest approach to solve this error.Should i follow the solution given in above question. i have already customized my user id property from string to int.