I'm creating MVC application, trying to get records out of database using CRUD, but then I get this error
"Multiple object sets per type are not supported. The object sets 'ApplicationUsers' and 'Users' can both contain instances of type 'WebApplication1.Models.ApplicationUser'."
I can't find "Users" property used anywhere, and when I replace all "ApplicationUser" with "User", I get this error:
"Multiple object sets per type are not supported. The object sets 'Users' and 'Users' can both contain instances of type 'WebApplication1.Models.ApplicationUser'."
I'm stuck and I have no idea what to do...
Edit:
namespace WebApplication1.Models
{
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
{
public string Name { get; set; }
public string DoB { get; set; }
public string Additional { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
public System.Data.Entity.DbSet<WebApplication1.Models.ApplicationUser> ApplicationUser { get; set; }
}