Beispiel #1
0
        public override async Task <IActionResult> DeleteEntity(int id)
        {
            IEnumerable <OrderDetail> existingOrderDetails = await _convertedRepo.GetAsync(id);

            if (!existingOrderDetails.Any())
            {
                return(NotFound());
            }
            bool hasDeletedEntities = await _convertedRepo.RemoveRangeAsync(existingOrderDetails);

            if (hasDeletedEntities)
            {
                return(new NoContentResult());
            }
            else
            {
                return(BadRequest());
            }
        }