public ActionResult Delete(int id, TableCmd TableCmd) { if (!ModelState.IsValid) { return(View()); } var exist = _TableCmdRepository.GetByID(id); if (exist == null) { return(NotFound()); } try { _TableCmdRepository.DeleteByID(id); _TableCmdRepository.Save(); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public void Update(TableCmd tableCmd) { _dbContext.Entry(tableCmd).State = Microsoft.EntityFrameworkCore.EntityState.Modified; }
public void Update(TableCmd TableCmd) { _dbContext.Entry(TableCmd).State = EntityState.Modified; }
public void Insert(TableCmd tableCmd) { _dbContext.TableCmds.Add(tableCmd); }
public void Add(TableCmd TableCmd) { _dbContext.TableCmds.Add(TableCmd); }