title: how to use async await functionality with MVC / Membershipprovider
body: <p>I would like to authenticate user using <a href="https://www.parse.com/" rel="nofollow">Parse Library</a>.</p>
  
  <p>Here are the methods which I would like to make it asyc as api call supports only async call. I am new to MVC and aysc/await functionality. 
  Problem now is that it goes in await method and never returns result and view cant be loaded. </p>
  
  <p>I spend quite some time understanding and trying to use different options but no success yet. </p>
  
  <p>Do I need to use Partialviews or something can be done in ValidateUser method.
  Any sample code is really appreciated. 
  Thanks. </p>
  
  <p>AccountController.cs</p>
  
  <pre><code>  public ActionResult Login(LoginModel model, string returnUrl)
      {
  
               if (ModelState.IsValid &amp;&amp; WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe))
                  {
                      var loggedIn = true;
                  }
          return  View(model);
      }
  </code></pre>
  
  <p>ParseMembershipProvider : ExtendedMembershipProvider</p>
  
  <pre><code>public override bool ValidateUser(string username, string password)
      {
  
          var pUserRepo = new PUserRepository();
          bool flag = false;
          var requiredUser = pUserRepo.GetUserObjByUserName(username, password );
  
  
          if (requiredUser.Result != null)
              flag = true;
  
          return flag;
  
      }
  </code></pre>
  
  <p>PUserRepository.cs</p>
  
  <pre><code> public async  Task&lt;ParseUser&gt; GetUserObjByUserName(string userName, string passWord)
  {
      return await ParseUser.LogInAsync("test1", "test123");
  }
  </code></pre>