public IActionResult Update([FromBody] CrudViewModel <SalesTargetLocation> payload) { SalesTargetLocation salestargetlocation = payload.value; _context.SalesTargetLocation.Update(salestargetlocation); _context.SaveChanges(); return(Ok(salestargetlocation)); }
public IActionResult Remove([FromBody] CrudViewModel <SalesTargetLocation> payload) { SalesTargetLocation salestargetlocation = _context.SalesTargetLocation .Where(x => x.SalesTargetLocationId == (int)payload.key) .FirstOrDefault(); _context.SalesTargetLocation.Remove(salestargetlocation); _context.SaveChanges(); return(Ok(salestargetlocation)); }