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