public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] MarketingMethod marketingMethod) { if (id != marketingMethod.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(marketingMethod); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MarketingMethodExists(marketingMethod.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(marketingMethod)); }
public async Task <IActionResult> Create([Bind("Id,Name")] MarketingMethod marketingMethod) { if (ModelState.IsValid) { _context.Add(marketingMethod); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(marketingMethod)); }