75 people following this project (follow)

NuGet packages

VB - https://nuget.org/packages/CodeFirstMembershipProvider

C# - https://nuget.org/packages/CodeFirstMembershipProviderSharp

Add and replace everything from Membership.config to your main Web.config.

VS 11 Beta, .NET 4.5 Beta, EF 5.0 Beta1 - Guide

  1. Uninstall ASP.NET Universal Providers For LocalDB
  2. Uninstall ASP.NET Universal Providers - Core dll
  3. Install CodeFirstMembership as you would usually
  4. Inside Visual Studio 11 open View -> Server Explorer
  5. Expand Data Connections
  6. Right-Click DefaultConnection -> Modify Connection
  7. Select from Database menu your Database (ApplicationName.DataContext)
  8. You are now working with LocalDB

Project Description

Custom Membership Provider built with Entity Framework Code-First, for use in ASP.NET MVC.

Features:

  • Based on default MembershipProvider implementation
  • Code-First approach
  • All membership fields can be renamed/changed/localized
  • Easily extendable (add additional fields)
  • Has a helper WebSecurity wrapper to extend Membership functionality
  • VB.NET and C# versions available

How to use:

  • Create a new MVC Web Application project
  • Download the NuGet package for either VB or C# version of your MVC project
  • Run the MVC project and tryout your membership
  • All standard Membership and Role methods work as expected

For consideration:

  • Amend the DataContext initialization strategy to your needs
  • Consider using WebSecurity methods instead of standard Membership methods where possible
  • Extend the WebSecurity module with further functionality.

Last edited Mar 6 at 10:39 AM by Se3ker, version 80