public async Task <ActionResult> Edit(int id, [FromForm] Member model) { if (ModelState.IsValid) { try { var client = new MemberClient(_config); var member = await client.Get(id); if (null == member) { return(NotFound()); } member.Active = model.Active; member.Alias = model.Alias; member.Email = model.Email; member.Notify = model.Notify; member.Email2 = model.Email2; member.Notify2 = model.Notify2; member.Email3 = model.Email3; member.Notify3 = model.Notify3; member.Name = model.Name; member.Note = model.Note; var response = await client.Update(member); if (response.IsSuccessStatusCode) { _toastNotification.AddSuccessToastMessage($"Le membre {model.Name} a été modifiée."); return(RedirectToAction(nameof(Index))); } } catch { return(View()); } } return(View(model)); }