public IActionResult Delete(int id)
 {
     try
     {
         var entity = _service.ProductionLines.Id(id).FirstOrDefault();
         if (entity == null)
         {
             return(NotFound(AppResult.NotFound()));
         }
         var validationData = _service.ValidateDeleteProductionLine(User, entity);
         if (!validationData.IsValid)
         {
             return(BadRequest(AppResult.FailValidation(data: validationData)));
         }
         _service.DeleteProductionLine(entity);
         context.SaveChanges();
         // must be in transaction
         var ev = _ev_service.DeleteProductionLine(entity, User);
         context.SaveChanges();
         return(NoContent());
     }
     catch (DbUpdateException e)
     {
         _logger.Error(e);
         return(BadRequest(AppResult.DependencyDeleteFail()));
     }
 }