开发者

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

开发者 https://www.devze.com 2023-04-08 21:07 出处:网络
I watc开发者_如何学Ched the “Creating immersive data experiences with Entity Framework “ video from this year’s BUILD conference and wanted to build out a simple application to test out the new fea

I watc开发者_如何学Ched the “Creating immersive data experiences with Entity Framework “ video from this year’s BUILD conference and wanted to build out a simple application to test out the new features of EF. But, I’d also like to use the ASP.NET Membership Provider for managing users and roles within my app and I am struggling to find a clean way to include it in my code first approach. Do you guys have any recommendations, suggestions, or examples on how this could be done?


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.


I found this NuGet package which has been very useful.

Quickstart sample for using Altairis Web Security, Entity Framework and Unity in MVC 3. Super easy membership user/role integration. When using this quickstart, the users and role part of your project is completely setup. You can signup, login, edit roles for users etc.

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


CodeFirstMembership may be what you are looking for.

Features:

  • Based on GUID's
  • Login either by entering Username or Email
  • Username and Email are unique
  • Uses nearly all features from SimpleMembershipProvider
  • Code-First approach
  • All membership fields can be renamed/changed/localized
  • Easily extendable (add additional fields)
  • VB.NET and C# versions available

Also, ShoelaceMVC is a great MVC3 starter project that implements CodeFirstMemebership and comes with a nice layout thanks to Twitter's Bootstrap.

0

精彩评论

暂无评论...
验证码 换一张
取 消