public IActionResult Edit(ProviderNoteViewModel selectedNoteToUpdate) { Provider updateNote = context.Providers.FirstOrDefault(u => u.ID == selectedNoteToUpdate.ID); updateNote.Name = selectedNoteToUpdate.Name; updateNote.SubscriberNumber = selectedNoteToUpdate.SubscriberNumber; updateNote.PagesToSave = selectedNoteToUpdate.PagesToSave; updateNote.SavedPagesDescription = selectedNoteToUpdate.SavedPagesDescription; updateNote.Address = selectedNoteToUpdate.Address; updateNote.BenefitRenewal = selectedNoteToUpdate.BenefitRenewal; updateNote.AuthNote = selectedNoteToUpdate.AuthNote; updateNote.MiscNotes = selectedNoteToUpdate.MiscNotes; context.Providers.Update(updateNote); return(RedirectToAction("Detail", updateNote.ID)); }
public IActionResult Edit() { ProviderNoteViewModel selectedNoteToUpdate = new ProviderNoteViewModel(); return(View(selectedNoteToUpdate)); }