public async Task <ActionResult> ChangeLastName(AccountKeeper model) { ApplicationUser Model = UserManager.FindById(User.Identity.GetUserId()); Model.UserLastName = model.NewValue; IdentityResult result = await UserManager.UpdateAsync(Model); return(RedirectToAction("Index")); }
public ActionResult PostingNews(AccountKeeper model) { using (_cont = new ApplicationDbContext()) { var res = _cont.Informations.Find(1); res.Message = model.NewValue; if (TryUpdateModel(res)) { _cont.SaveChanges(); } } return(View("Index")); }