Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
As the title says, I created a new MVC project with visual c# and authentication. Then I've implemented the desired models (and created the database with code first entity framework). What I want to do now is add to that database the intelligence of the authentication that was created by visual studio and addapt it to map my entities.
For instance, I've got a table called Clients. I want that each client have it's own login and permissions. How can I do that?
Thanks
Posted
Updated 1-Jun-15 6:31am
v2

1 solution

Entity framework is based on DML stuff (data manipulation), so using it for CRUD operations won't be a bad idea. But creating a login system on the top of it, would not be a good idea. You would have to create a lot of modules and other stuff. So, don't!

Instead of this, you can use ASP.NET Identity[^]. Identity has a lot of good features, and allows you to take controls of everything (yes, everything) that goes on under the hood. You can use the API to create your own services and use them in your application, change how the Identity system works, add more packages to it and so on.

So, instead of using Entity framework for user logins and permissions (groups or roles, right?) you should use ASP.NET Identity.
 
Share this answer
 
Comments
Member 11733471 1-Jun-15 12:50pm    
Perhaps I didn't explain myself well but that is what I did in first term. What I didn't know was that it was an API. Now that I do, how do I merge (or persist) values from that authentication system with my database?
Afzaal Ahmad Zeeshan 1-Jun-15 13:27pm    
Please re-read the answer, I already have given you the answer. You should use ASP.NET Identity for this purpose. It would be helpful to you instead of creating your own authentication system. ASP.NET Identity would automatically merge itself in the system.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900