EF 4.1 Update 1 First Code + ASP.NET Membership Provider

I watched the video “Creating Exciting Data Using the Entity Framework” from this BUILD conference this year and wanted to create a simple application to test new EF features. But, Id would also like to use the ASP.NET Member Provider to manage users and roles in my application, and I am struggling to find a clean way to include it in my first approach to the code. Do you have recommendations, suggestions or examples of how this can be done?

+6
source share
3 answers

I would recommend looking at the MVC3-Boilerplate project on GitHub, as it has a good example of creating a custom membership provider that is implemented using EF Code First.

0
source

I found this NuGet package which was very useful.

Quick Launch Example for Using Altairis Web Security, Entity Framework, and Unity in MVC 3. Intelligent User / User Role Integration. When using this quick launch, the user and part of the role of your project are fully configured. You can register, register, edit roles for users, etc.

http://www.nuget.org/List/Packages/quickstart.mvc3.unity.ef.altairiswebsecurity

0
source

CodeFirstMembership may be what you are looking for.

Features:

  • GUID Based
  • Log in with your username or email address.
  • Username and email are unique.
  • Uses almost all SimpleMembershipProvider functions
  • Code-First Method
  • All membership fields can be renamed / changed / localized.
  • Easily extensible (add additional fields)
  • VB.NET and C # Versions Available

In addition, ShoelaceMVC is an excellent MVC3 starter project that implements CodeFirstMemeberhip and comes in a nice location thanks to Twitter Bootstrap .

0
source

Source: https://habr.com/ru/post/898227/


All Articles