title: ASP.NET MVC Custom Membership Provider - How to overload CreateUser?
body: <p>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).</p>
  
  <p>In my custom Membership Provider I'm trying to overload CreateUser method like this:</p>
  
  <pre><code>    public override MyMembershipUser CreateUser(string firstName, string lastName, 
                                         string email, string password)
      {
          ...
      }
  </code></pre>
  
  <p>But when I want to call it from the Account controller:</p>
  
  <pre><code>    [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);
      }
  </code></pre>
  
  <p>I get the error stating that "No overload for method takes 4 arguments".</p>
  
  <p>How do I call my custom CreateUser method from Custom Membership Provider class?</p>
  
  <p>Thank you!</p>