Click here to Skip to main content
Licence CPOL
First Posted 29 Oct 2008
Views 58,430
Downloads 1,119
Bookmarked 50 times

Custom membership provider for the ADO.NET Entity Framework

By Michael Ulmann | 29 Oct 2008
Custom membership provider implementation for the ADO.NET Entity Framework.
1 vote, 5.9%
1
2 votes, 11.8%
2
3 votes, 17.6%
3
1 vote, 5.9%
4
10 votes, 58.8%
5
4.13/5 - 17 votes
1 removed
μ 3.71, σa 2.43 [?]

Introduction

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)

About the Author

Michael Ulmann

Architect
Helvetic Solutions
Australia Australia

Member
MCAD, MCPD Web Developer 2.0, MCPD Enterprise Developer 3.5
My company: www.helveticsolutions.com
Hopp Schwiiz Smile | :)

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 2 PinmemberNeerajan Lamsal1:31 22 Apr '11  
QuestionSmartSoft.pfx password? Pinmemberdownatone_77710:22 14 Sep '10  
GeneralMy vote of 3 PinmemberGil Fink1:35 28 Jul '10  
QuestionHow does this compare... PinmemberDLester0110:25 18 Apr '10  
QuestionHow can we insert values into FirstName,LastName fields in the Db PinmemberMember 347355312:52 4 Aug '09  
GeneralRole and Profile providers Pinmembershapper10:18 27 Jul '09  
GeneralRe: Role and Profile providers PinmemberMichael Ulmann1:40 30 Jul '09  
GeneralRe: Role and Profile providers Pinmembershapper7:04 31 Jul '09  
GeneralRe: Role and Profile providers PinmemberMichael Ulmann22:43 31 Jul '09  
GeneralRe: Role and Profile providers PinmemberMichael Ulmann0:47 1 Aug '09  
GeneralAdd'l Providers PinmemberJeff Bowman11:19 24 Jul '09  
GeneralRe: Add'l Providers PinmemberMichael Ulmann15:10 1 Aug '09  
GeneralRe: Add'l Providers PinmemberJeff Bowman20:00 1 Aug '09  
GeneralHydrating from EFExtensions Pinmemberjonranes0:24 13 Mar '09  
GeneralRe: Hydrating from EFExtensions PinmemberMichael Ulmann15:10 1 Aug '09  
GeneralMy vote of 2 Pinmemberandrewward3:11 16 Feb '09  
It is very difficult to work out what this code would do other than to download it and build it.
QuestionAre the other providers ready? Pinmemberjetset329:49 11 Jan '09  
AnswerRe: Are the other providers ready? PinmemberMichael Ulmann12:34 11 Jan '09  
GeneralRe: Are the other providers ready? Pinmemberjetset329:22 12 Jan '09  
GeneralRe: Are the other providers ready? PinmemberRoger Jakobsson12:01 13 Feb '09  
GeneralRe: Are the other providers ready? PinmemberMichael Ulmann15:10 1 Aug '09  
GeneralA forgotten thing PinmemberFatihSever16:17 2 Dec '08  
QuestionRe: A forgotten thing Pinmemberalibaba0690:37 9 Dec '08  
AnswerRe: A forgotten thing PinmemberFatihSever2:09 12 Dec '08  
GeneralRe: A forgotten thing PinmemberMichael Ulmann18:12 15 Dec '08  

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.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120210.1 | Last Updated 29 Oct 2008
Article Copyright 2008 by Michael Ulmann
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid