ASP.NET Membership implementation based on LLBLGen

Posts   
 
    
Posts: 19
Joined: 03-Feb-2006
# Posted on: 03-Feb-2006 11:48:48   

Hajo,

do you know if there is existing implementation of Membership that is based on LLBLGen? I suppose I can write it from scratch but I wouldn't like to reinvent the wheel.

erichar11
User
Posts: 268
Joined: 08-Dec-2003
# Posted on: 03-Feb-2006 18:49:07   

I haven't yet, but over the weekend I may try. If you want to work on this together, just let me know. I think another user has implmented this (alex....), and hopefully he can show us some code.stuck_out_tongue_winking_eye

Posts: 19
Joined: 03-Feb-2006
# Posted on: 06-Feb-2006 13:11:58   

erichar11 wrote:

I haven't yet, but over the weekend I may try. If you want to work on this together, just let me know. I think another user has implmented this (alex....), and hopefully he can show us some code.stuck_out_tongue_winking_eye

Ok, why not I've just started working on it. My assumptions are as follows:

I'm going to create:

  1. my own MyMembershipProvider class
  2. my own MyRoleProvider class
  3. my own User class that derives from MembershipUser class Here we have first problem, my User class has to derive from MembershipUser but at the same time it has to derive from EntityBase. I can derive only from one class and I decided to derive from MembershipUser and EntityBase will be aggregated within User class.
    It’s not very handy because I have to reimplement all properties only in order to assign their values to EntityBase variable.
    
class UserEntity : EntityBase
{}

class User : MembershipUser
{
    private UserEntity _userEntity;
            
        public string FavouriteMovie
        {
           set {  _userEntity.FavouriteMovie = value; }
        }
}

  1. my own Role class that derives from EntityBase, unfortunatelly RoleManger uses String insted of "Role" class and therfore implementing MyRoleProvider I will have to transform Role object to String object.

I'm going to have one table per Role and User class. There is many to many relation between User and Role.

that's it.

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 06-Feb-2006 14:10:16   

Firstly, this subject is a bit out of my depth...but then I got interested in it just last week after seeing this thread. I have since looked into it and come across the following interesting URL's.

http://msdn2.microsoft.com/en-us/library/317sza4k(en-US,VS.80).aspx http://msdn2.microsoft.com/en-us/library/f1kyba5e(en-US,VS.80).aspx

Looking at the example code, it seems to me that to create a LLBLProvider, you would need to replace the ODBC API and SQL with LLBL equalant. Is that not the case?

For example, method

Public Overrides Sub CreateRole(rolename As String)

creates instantiates a OdbcConnection and OdbcCommand objects, stuffs the insert SQL, sets up the params, then Open(), and ExecuteNonQuery().

What are issues if all this is replaced with LLBL, i.e instratiate a roleEnity, set attrbutes, and then save.

Or am I missing something.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 06-Feb-2006 15:07:44   
  1. my own User class that derives from MembershipUser class Here we have first problem, my User class has to derive from MembershipUser but at the same time it has to derive from EntityBase. I can derive only from one class and I decided to derive from MembershipUser and EntityBase will be aggregated within User class. It’s not very handy because I have to reimplement all properties only in order to assign their values to EntityBase variable

You may have you User class that inherits from MembershipUser And a UserEntity Class, that inherits from EntityBase or EntityBase2 Then you might have conversion methods in either of those classes (or in both)

as follows, in the User Class you may have :


ToUserEntity(out UserEntity objUserEntity)
{
objUserEntity.Id = this.Id;
objUserEntity.name = this.name;
...
}

FromUserEntity(UserEntity objUserEntity)
{
this.Id = objUserEntity.Id;
this.name = objUserEntity.name;
...
}
C4 avatar
C4
User
Posts: 32
Joined: 12-Nov-2005
# Posted on: 07-Feb-2006 07:44:19   

Pawel wrote:

Ok, why not I've just started working on it. My assumptions are as follows:

I would be interested in this code once completed... stuck_out_tongue_winking_eye

Posts: 19
Joined: 03-Feb-2006
# Posted on: 07-Feb-2006 18:00:00   

Exactlly, but I prefere overloading "implict" operator because then the conversion happens behind the scenes.