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());
            }
        }
예제 #2
0
 public void Update(TableCmd tableCmd)
 {
     _dbContext.Entry(tableCmd).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
 }
예제 #3
0
 public void Update(TableCmd TableCmd)
 {
     _dbContext.Entry(TableCmd).State = EntityState.Modified;
 }
예제 #4
0
 public void Insert(TableCmd tableCmd)
 {
     _dbContext.TableCmds.Add(tableCmd);
 }
예제 #5
0
 public void Add(TableCmd TableCmd)
 {
     _dbContext.TableCmds.Add(TableCmd);
 }