Error on creating Database Controller
HI
I am a beginner in VS2012 ASP.net MVC. I am trying to do a page for Login with Database. and i have created a model with the following code
HTML Code:
public class UserMain
{
public class UserMaintenance
{
public int UserID { get; set; }
public string UserName { get; set; }
public string Email { get; set; }
}
public class ConnLogin : DbContext
{
public DbSet<UserMaintenance> UserMaintenance { get; set; }
}
}
and from this am trying to create a controller but it displays the following error.
HTML Code:
'Login.Models.Usermain' is not part of the specified 'Login.Models.Usermain+ConnLogin' Class, and the 'Login.Models.Usermain+ConnLogin' class couldnt be modified to add a 'Dbset<Login.Models.UserMain>' property to it. (For example, the 'Login.Modeules.UserMain+ConnLogin' class might be in a compiled assemply.)
Please help me...i am stuck here for two days....
Re: Error on creating Database Controller
Your class seems to imply that it's called UserMain but the error message states that it's Usermain.