I'm trying to build Custom Membership Provider. I would like to capture additional information (First Name and Last Name) during the registration and I'm not using usernames (email is a login).
In my custom Membership Provider I'm trying to overload CreateUser method like this:
public override MyMembershipUser CreateUser(string firstName, string lastName,
string email, string password)
{
...
}
But when I want to call it from the Account controller:
[HttpPost]
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
// Attempt to register the user
MembershipCreateStatus createStatus;
Membership.CreateUser(model.FirstName, model.LastName,
model.Email, model.Password);
if (createStatus == MembershipCreateStatus.Success)
{
return RedirectToAction("Index", "Home");
}
else
{
ModelState.AddModelError("", ErrorCodeToString(createStatus));
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
I get the error stating that "No overload for method takes 4 arguments".
How do I call my custom CreateUser method from Custom Membership Provider class?
Thank you!