예제 #1
0
        public async Task <IActionResult> Delete(int id)
        {
            Customer customer = _context.Customers.Where(x => x.Id == id).FirstOrDefault();

            if (customer != null)
            {
                _context.Remove(customer);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(BadRequest());
        }