예제 #1
0
        public IActionResult Update([FromBody] CrudViewModel <Lab2_DellDeskComp> payload)
        {
            Lab2_DellDeskComp lab2_DellDeskComp = payload.value;

            _context.Lab2_DellDeskComp.Update(lab2_DellDeskComp);
            _context.SaveChanges();
            return(Ok(lab2_DellDeskComp));
        }
예제 #2
0
        public IActionResult Remove([FromBody] CrudViewModel <Lab2_DellDeskComp> payload)
        {
            Lab2_DellDeskComp lab2_DellDeskComp = _context.Lab2_DellDeskComp
                                                  .Where(x => x.LogId == (long)payload.key)
                                                  .FirstOrDefault();

            _context.Lab2_DellDeskComp.Remove(lab2_DellDeskComp);
            _context.SaveChanges();
            return(Ok(lab2_DellDeskComp));
        }