diff --git a/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs b/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs index 8497091..deb1a82 100644 --- a/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs +++ b/ComputerShopBusinessLogic/BusinessLogics/ProductLogic.cs @@ -77,7 +77,7 @@ namespace ComputerShopBusinessLogic.BusinessLogics public bool Delete(ProductBindingModel Model) { CheckModel(Model, false); - _logger.LogInformation("Delete. Id:{Id}", Model.Id); + _logger.LogInformation("Delete. Id: {Id}", Model.Id); if (_productStorage.Delete(Model) is null) { @@ -88,6 +88,17 @@ namespace ComputerShopBusinessLogic.BusinessLogics return true; } + public bool BindShipment(ProductBindingModel Model) + { + if (Model.ShipmentId == null) + { + _logger.LogInformation("Trying to bind null shipment to product with Id: {Id}", Model.Id); + return false; + } + + return Update(Model); + } + private void CheckModel(ProductBindingModel Model, bool WithParams = true) { if (Model == null) diff --git a/ComputerShopContracts/BusinessLogicContracts/IProductLogic.cs b/ComputerShopContracts/BusinessLogicContracts/IProductLogic.cs index 005a7fa..a858120 100644 --- a/ComputerShopContracts/BusinessLogicContracts/IProductLogic.cs +++ b/ComputerShopContracts/BusinessLogicContracts/IProductLogic.cs @@ -15,5 +15,7 @@ namespace ComputerShopContracts.BusinessLogicContracts bool Update(ProductBindingModel Model); bool Delete(ProductBindingModel Model); + + bool BindShipment(ProductBindingModel Model); } } diff --git a/ComputerShopRestApi/WeatherForecast.cs b/ComputerShopRestApi/WeatherForecast.cs deleted file mode 100644 index dca73e3..0000000 --- a/ComputerShopRestApi/WeatherForecast.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace ComputerShopRestApi -{ - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } - } -}