public async Task <IActionResult> Edit(int id, [Bind("ContactName,ID,IsPrimary,Mobile,Landline,Email")] EventLocationContactDetail eventLocationContactDetail) { if (id != eventLocationContactDetail.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(eventLocationContactDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventLocationContactDetailExists(eventLocationContactDetail.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(eventLocationContactDetail)); }
public async Task <IActionResult> Create([Bind("ContactName,ID,IsPrimary,Mobile,Landline,Email")] EventLocationContactDetail eventLocationContactDetail) { if (ModelState.IsValid) { _context.Add(eventLocationContactDetail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(eventLocationContactDetail)); }