title: How does Membership.ValidateUser method access a database?
body: <p>I wanted to build a membership system at the beginning of my MVC project and I used Membership.ValidateUser method to verify credentials. However I could not understand how does this method access my database and check my email and password informations.</p>
  
  <pre><code>[HttpPost]
  [ActionName("Login")]
  public ActionResult Login(LoginModel loginModel)
  {
          if (Membership.ValidateUser(loginModel.Email, loginModel.Password))
          {
              FormsAuthentication.SetAuthCookie(loginModel.Email, true);
              return Json(true);
          }
  
          return new JsonNetResult() 
          { Data = new { Error = true, Messages = new[] { new { Message = "Wrong username or password" } } } };
  }
  </code></pre>