public ActionResult Update(ContextViewModel contextViewModel) { if (ModelState.IsValid) { var context = new Context(); context.Id = contextViewModel.Id; context.Name = contextViewModel.Name; context.IsMainContext = contextViewModel.IsMainContext; context.CurrencyTypeId = contextViewModel.CurrencyTypeId; context.CountryId = contextViewModel.CountryId; context.UserId = GetCurrentUserId(); _contextService.AddOrUpdate(context); return(RedirectToAction("Index", "Dashboard")); } else { SendModelStateErrors(); return(View(contextViewModel)); } }