title: Implementing Custom MembershipUser
body: <p>I am going round in circles and need some help in implementing a Custom MembershipUser so that I can add my own custom Properties to the MembershipUser.</p>
  <p>I have been following the example on this site: <a href="http://msdn.microsoft.com/en-us/library/ms366730.aspx" rel="noreferrer">How to: Implement a Custom Membership User</a></p>
  <p><strong>The problem I am having is in the constructor of CustomMembershipUser, I think.</strong></p>
  <p>My CustomMembershipUser has these three additional Properties: firstName, middleName, lastName.</p>
  <pre><code>public class CustomMembershipProvider : MembershipProvider
  {
    public override MembershipUser GetUser(string username, bool userIsOnline)
      {
         //.... Get data from database
         MembershipUser baseUser = new MembershipUser(this.Name,
                                                 username,
                                                 userId,
                                                 email,
                                                 &quot;&quot;,
                                                 comment,
                                                 isApproved,
                                                 isLockedOut,
                                                 dtCreate,
                                                 dtLastLogin,
                                                 dtLastActivity,
                                                 DateTime.Now,
                                                 dtLastLockoutDate);
                      return new CustomMembershipUser(baseUser, firstName, middleName, lastName)
      }
  }
  
  
  public class CustomMembershipUser : MembershipUser
  {
    private string _firstName;
      public string FirstName { get { return _firstName; } set { _firstName = value; } }
  
      private string _middleName;
      public string MiddleName { get { return _middleName; } set { _middleName = value; } }
  
      private string _lastName;
      public string LastName { get { return _lastName; } set { _lastName = value; } }
  
   public CustomMembershipUser(MembershipUser baseuser, string firstname, string middlename, string lastname)
      {
          _firstName = firstname;
          _middleName = middlename;
          _lastName = lastname;
  
          new CustomMembershipUser(baseuser); // DO I NEED THIS?? HOW TO IMPLEMENT??
          
      }
  }
  </code></pre>
  <p>I am calling it like so:</p>
  <pre><code>    MembershipUser mu = Membership.GetUser(UserName);
  
      CustomMembershipProvider p = (CustomMembershipProvider)Membership.Provider;
      
      MembershipUser memUser = p.GetUser(UserName, true);
  
      object userId = memUser.ProviderUserKey;
  </code></pre>
  <p>The ProviderUserKey is null and so are the other values.</p>
  <p>How can I obtain the addition Properties I added?</p>
  <p>Thanks</p>