How do you design your code-first approach in entity framework when your code should include user data (name, password...) without repeating/overwriting what the MVC framework will generate in terms of user tables, classes, authorization and authentication
As simple example, if i have an application that will manage user projects, my models will contain the following classes, and have the following relationship:
- One user may be assigned one or MANY projects - One project may be assigned to one or MANY users
( just to show the many to many ERD relationship nature)
class User{ //implementation of the class members and // navigation properties to alow Entity Framework to create the DB tables } class Project{ //implementation of the class members and // navigation properties to alow Entity Framework to create the DB tables }
Now the problem i am facing is that EF and ASP .net MVC framework takes care of creating user tables, profiles and roles entities...
I am not sure whether it is possible to design my classes in a way to show an automatic (conventional) relationship with the rest of the tables created by MVC.
In the case this needs to be done by writting custom Authentication classes, can you please explain how? because i have found many articles that discuss the same issue but without pointing out the relationship between the project classes and the MVC created classes / tables, plus if the developer choses to use the MVC way he will end up with two data contexts, even after merging both tables in one sql server catalog.
User
class, how would you go about adding these new features?