// To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } await _client.PutContactAsync(Contact.Id, Contact); return(RedirectToPage("./Index")); }
public async Task <ActionResult> Edit(int id, IFormCollection collection) { try { Contact updateC = new Contact() { ContactId = id, FullName = collection["FullName"] }; var c = await cl.PutContactAsync(id, updateC); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }