Custom Membership Provider - Implementation Questionhttp://forums.asp.net/t/1416545.aspx/1?Custom+Membership+Provider+Implementation+QuestionTue, 28 Apr 2009 20:37:26 -040014165453125110http://forums.asp.net/p/1416545/3125110.aspx/1?Custom+Membership+Provider+Implementation+QuestionCustom Membership Provider - Implementation Question <p>&nbsp;Hi all, </p> <p>I started implementing a Custom Membership Provider that would keep all membership data in one table, would have only one user class and also would have the data layer managed by an ORM (Telerik ORM) for easy porting from one project to another. I researched this topic and found a couple of sample implementations but it seems that instead of having one class to hold all membership data&nbsp; there is always the System.Web.Security.MembershipUser and another class that inherits from it(not always but you still get two classes), and there is a bunch of casting and instatiating new objects and moving data from one to another involved. </p> <p>Now is there a way to have a Custom Membership Provider without having to have two classes and keep exchanging data between the both ? I think the approach of having to inherit classes is not as good as having to implement an interface, for some reason i think if MS would have provided an interface to be implemented using two classes would have not been necessary.</p> <p>What do you guys think ? Any help is greatly appreciated !&nbsp; <br> </p> 2009-04-28T14:11:48-04:003125947http://forums.asp.net/p/1416545/3125947.aspx/1?Re+Custom+Membership+Provider+Implementation+QuestionRe: Custom Membership Provider - Implementation Question <p>You can simply inhert Membership class and can write your custom BLL class call to validate employee logins. See below example for an idea about how it will work.</p> <font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">Public</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">Class</font></font><font size="2"> LiveMembershipProvider<br> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">Inherits</font></font><font size="2"> MembershipProvider</font></p> <font size="2"><font color="#0000ff" size="2"><font color="#0000ff" size="2"> <p>Public</font></font><font size="2"> AccountEmployeeBLL </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">As</font></font><font size="2"> AccountEmployeeBLL</font></p> <p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Public Overrides Function ValidateUser(ByVal username As String, ByVal password As String) As Boolean<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return Me.AccountEmployeeBLL.ValidateLogin(username, password)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Function</p> </font></font> 2009-04-28T20:37:26-04:00