Ok assuming I am going to use the ASP.NET Membership provider. Take the following example:
public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
throw new NotImplementedException();
}
This is what is available in the MembershipProvider abstract class which I need to implement. But since my schema is very different, the following is what I really need:
public override MembershipUser CreateUser(string password, string email, string telephone = "", string mobile = "",
string fname = "", string lname = "", int credits = 0, int pCredits = 20, out MembershipCreateStatus status)
{
User user = new User
{
FirstName = fname,
LastName = lname,
Email = email,
Password = password,
Credits = credits,
PromotionalCredits = pCredits,
Telephone = telephone,
Mobile = mobile,
};
_repository.AddNewUser(user);
_repository.CommitChanges();
status = MembershipCreateStatus.Success;
return _repository.GetUsers().ByEmail(email);
}
But this ofcourse throws an error saying that there is no suitable method found to override, which makes sense. So, do I create my own overload of the CreateUser() method which also returns a MembershipUser, or is there anything else I should do?
P.S: I never implemented the MembershipProvider before, so bare with me please :)