public IActionResult PersonalInformations(CustomerView customer) { if (ModelState.IsValid) { eCommerce.UpdateCustomer(int.Parse(customer.Id), new CustomerUpdateModel { FirstName = customer.FirstName, MiddleName = customer.MiddleName, LastName = customer.LastName }, out ICollection <string> errors); if (errors.Any()) { ViewData[GlobalViewBagKeys.Errors] = errors; } else { CustomerView updatedCustomer = eCommerce.GetCustomerBy(int.Parse(customer.Id)); loginPersistence.Logout(); loginPersistence.LoginThrough(int.Parse(updatedCustomer.Id)); ICollection <string> messages = new List <string>(); messages.Add("Personal informations updated"); ViewData[GlobalViewBagKeys.Messages] = messages; return(View(updatedCustomer)); } } return(View(customer)); }