public async Task <IActionResult> Edit(int id, [Bind("TabcaId,TabcaName,Pic,Del,Description")] Tbltablecategory tbltablecategory) { if (id != tbltablecategory.TabcaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tbltablecategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbltablecategoryExists(tbltablecategory.TabcaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tbltablecategory)); }
public async Task <IActionResult> Create([Bind("TabcaId,TabcaName,Pic,Del,Description")] Tbltablecategory tbltablecategory) { if (ModelState.IsValid) { _context.Add(tbltablecategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tbltablecategory)); }