public async Task <IActionResult> Edit(int id, [Bind("TeaId,TeaStoreId")] TeaStoreLink teaStoreLink) { if (id != teaStoreLink.TeaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(teaStoreLink); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TeaStoreLinkExists(teaStoreLink.TeaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(teaStoreLink)); }
public async Task <IActionResult> Create([Bind("TeaId,TeaStoreId")] TeaStoreLink teaStoreLink) { if (ModelState.IsValid) { _context.Add(teaStoreLink); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(teaStoreLink)); }