public async Task <JsonResult> Update(int id, Customer customer) { if (ModelState.IsValid) { CustomerProvider customerProvider = new CustomerProvider(); return(Json(await customerProvider.EditAsync(id, customer))); } else { return(Json(MessageManager.GetErrorMessage(ModuleType.Customer, MessageType.ModelFailed))); } }