title: Asp.net MVC UserManager Update
body: <p>I have tried to update user data in database, I am taking value from view and I assign these data to current user.Yet, I am taking an error in that line when I update user's data <code>var result = await UserManager.UpdateAsync(userAccount);</code>.It is written <strong>Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.</strong> .How can I fix that? Thanks</p>
  
  <p><strong>CONTROLLER:</strong></p>
  
  <pre><code>public ApplicationUserManager UserManager
      {
          get
          {
              return _userManager ?? HttpContext.GetOwinContext().GetUserManager&lt;ApplicationUserManager&gt;();
          }
          private set
          {
              _userManager = value;
          }
      }
  
      [HttpPost]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; ModifyAccount(ModifyUserAccountViewModel model)
      {
          var user = await UserManager.FindByIdAsync(int.Parse(User.Identity.GetUserId()));
          UserAccount userAccount = (UserAccount)user;
          userAccount.surname = model.surname;
          userAccount.name = model.name;
          userAccount.Email = model.email;
          var result = await UserManager.UpdateAsync(userAccount);
          if (result.Succeeded)
          {
              return RedirectToAction("Index", new { Message = "Account modyfyied successfully!" });
          }
          AddErrors(result);
          return View("Error");
       }
  </code></pre>
  
  <p><strong>Startup.cs:</strong></p>
  
  <pre><code>public void Configuration(IAppBuilder app)
      {
          ConfigureAuth(app);
          app.CreatePerOwinContext&lt;ApplicationUserManager&gt;(ApplicationUserManager.Create);          
      }
  </code></pre>