public async Task DeleteProductionLineAsync(int productionLineId) { await _productionLineRepository.Delete(new ProductionLine() { Id = productionLineId }); }
public async Task DeleteProductionLineById(Guid id) { if (!_productionLineRepository.Exists(id).Result) { throw new KeyNotFoundException(); } await _productionLineRepository.Delete(id); }
public ActionResult <ProductionLine> DeleteProductionLine(int id) { ProductionLine productionLine = _productionLineRepository.GetBy(id); if (productionLine == null) { return(NotFound()); } _productionLineRepository.Delete(productionLine); _productionLineRepository.SaveChanges(); return(productionLine); }
public ActionResult <ProductionLine> DeleteProductionLine(int id) { return(Ok(_IProductionLineRepository.Delete(id))); }