Click here to Skip to main content
Click here to Skip to main content
Go to top

Custom membership provider for the ADO.NET Entity Framework

, 3 Jan 2013
Rate this:
Please Sign up or sign in to vote.
Custom membership provider implementation for the ADO.NET Entity Framework.

Introduction

Note: This article has been superseded by the following code project article. 

This article describes the implementation of a custom membership provider for the ADO.NET entity framework. The code presented in this article fully complies with Microsoft's provider model design pattern. It also leverages the LINQ to Entities feature introduced with framework 3.5.

Background

It is required to have a basic understanding of the ADO.NET Entity Framework and the ASP.NET membership provider model in order to successfully integrate the presented solution.

Using the code

To configure the attached sample, the following steps have to be taken into account:

  1. Create a database (e.g., EFDataModel).
  2. Run the CreateUserTable.sql script located in the DatabaseScripts solution folder.
  3. Modify the connection string for the Entity Framework in the App.config file of the SmartSoft.EFMembershipProvider.DataLayer project.
  4. Modify connection string for the Entity Framework in the Web.config file of the Web application.

If you want to integrate the custom membership provider into your existing application, you might have to replace the object context EFDataModelEntities within the membership provider class according to your entity model.

Depending on your data model, the method DeleteUser within the membership provider class has to be extended from line 698 onwards in order to delete/mark all user related data.

History

  • 29/10/2008 - Initial article posted.

License

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

Share

About the Author

Michael Ulmann
Architect Helvetic Solutions
Australia Australia
MCAD, MCPD Web Developer 2.0, MCPD Enterprise Developer 3.5
My company: www.helveticsolutions.com
Hopp Schwiiz Smile | :)

Comments and Discussions

 
GeneralRe: Role and Profile providers PinmemberMichael Ulmann30-Jul-09 0:40 
GeneralRe: Role and Profile providers Pinmembershapper31-Jul-09 6:04 
GeneralRe: Role and Profile providers PinmemberMichael Ulmann31-Jul-09 21:43 
GeneralRe: Role and Profile providers PinmemberMichael Ulmann31-Jul-09 23:47 
GeneralAdd'l Providers PinmemberJeff Bowman24-Jul-09 10:19 
GeneralRe: Add'l Providers PinmemberMichael Ulmann1-Aug-09 14:10 
GeneralRe: Add'l Providers PinmemberJeff Bowman1-Aug-09 19:00 
GeneralHydrating from EFExtensions Pinmemberjonranes12-Mar-09 23:24 
GeneralRe: Hydrating from EFExtensions PinmemberMichael Ulmann1-Aug-09 14:10 
GeneralMy vote of 2 Pinmemberandrewward16-Feb-09 2:11 
QuestionAre the other providers ready? Pinmemberjetset3211-Jan-09 8:49 
AnswerRe: Are the other providers ready? PinmemberMichael Ulmann11-Jan-09 11:34 
GeneralRe: Are the other providers ready? Pinmemberjetset3212-Jan-09 8:22 
GeneralRe: Are the other providers ready? PinmemberRoger Jakobsson13-Feb-09 11:01 
GeneralRe: Are the other providers ready? PinmemberMichael Ulmann1-Aug-09 14:10 
GeneralA forgotten thing PinmemberFatihSever2-Dec-08 15:17 
QuestionRe: A forgotten thing Pinmemberalibaba0698-Dec-08 23:37 
AnswerRe: A forgotten thing PinmemberFatihSever12-Dec-08 1:09 
GeneralRe: A forgotten thing PinmemberMichael Ulmann15-Dec-08 17:12 
QuestionAdding an entry in the DB Pinmemberalibaba0691-Dec-08 0:19 
GeneralThanks a lot PinmemberFatihSever26-Nov-08 11:26 
JokeRe: Thanks a lot Pinmemberalibaba06929-Nov-08 8:32 
AnswerRe: Thanks a lot PinmemberMichael Ulmann30-Nov-08 11:24 
Generalfor dotnet2.0 not linq Pinmemberhungud9-Nov-08 20:05 
AnswerRe: for dotnet2.0 not linq PinmemberMichael Ulmann9-Nov-08 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 3 Jan 2013
Article Copyright 2008 by Michael Ulmann
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid