Skip to main content
Email Password   helpLost your password?

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

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralHow can we insert values into FirstName,LastName fields in the Db Pin
Member 3473553
12:52 4 Aug '09  
GeneralRole and Profile providers Pin
shapper
10:18 27 Jul '09  
GeneralRe: Role and Profile providers Pin
Michael Ulmann
1:40 30 Jul '09  
GeneralRe: Role and Profile providers Pin
shapper
7:04 31 Jul '09  
GeneralRe: Role and Profile providers Pin
Michael Ulmann
22:43 31 Jul '09  
GeneralRe: Role and Profile providers Pin
Michael Ulmann
0:47 1 Aug '09  
GeneralAdd'l Providers Pin
Jeff Bowman
11:19 24 Jul '09  
GeneralRe: Add'l Providers Pin
Michael Ulmann
15:10 1 Aug '09  
GeneralRe: Add'l Providers Pin
Jeff Bowman
20:00 1 Aug '09  
GeneralHydrating from EFExtensions Pin
jonranes
0:24 13 Mar '09  
GeneralRe: Hydrating from EFExtensions Pin
Michael Ulmann
15:10 1 Aug '09  
GeneralMy vote of 2 Pin
andrewward
3:11 16 Feb '09  
GeneralAre the other providers ready? Pin
jetset32
9:49 11 Jan '09  
AnswerRe: Are the other providers ready? Pin
Michael Ulmann
12:34 11 Jan '09  
GeneralRe: Are the other providers ready? Pin
jetset32
9:22 12 Jan '09  
GeneralRe: Are the other providers ready? Pin
Roger Jakobsson
12:01 13 Feb '09  
GeneralRe: Are the other providers ready? Pin
Michael Ulmann
15:10 1 Aug '09  
GeneralA forgotten thing Pin
FatihSever
16:17 2 Dec '08  
QuestionRe: A forgotten thing Pin
alibaba069
0:37 9 Dec '08  
AnswerRe: A forgotten thing Pin
FatihSever
2:09 12 Dec '08  
GeneralRe: A forgotten thing Pin
Michael Ulmann
18:12 15 Dec '08  
QuestionAdding an entry in the DB Pin
alibaba069
1:19 1 Dec '08  
GeneralThanks a lot Pin
FatihSever
12:26 26 Nov '08  
JokeRe: Thanks a lot Pin
alibaba069
9:32 29 Nov '08  
AnswerRe: Thanks a lot Pin
Michael Ulmann
12:24 30 Nov '08  


Last Updated 29 Oct 2008 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009