From 52ba1507659ee01cf50e8f13bcb9c8a8562a4b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 14:26:38 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=BD=D0=B0=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ConfectionaryBusinessLogic/PastryLogic.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ConfectionaryBusinessLogic/PastryLogic.cs b/ConfectionaryBusinessLogic/PastryLogic.cs index 32446c4..042d5c9 100644 --- a/ConfectionaryBusinessLogic/PastryLogic.cs +++ b/ConfectionaryBusinessLogic/PastryLogic.cs @@ -10,18 +10,18 @@ namespace ConfectioneryBusinessLogic.BusinessLogics public class PastryLogic : IPastryLogic { private readonly ILogger _logger; - private readonly IPastryStorage _componentStorage; - public PastryLogic(ILogger logger, IPastryStorage componentStorage) + private readonly IPastryStorage _pastryStorage; + public PastryLogic(ILogger logger, IPastryStorage pastryStorage) { _logger = logger; - _componentStorage = componentStorage; + _pastryStorage = pastryStorage; } public List? ReadList(PastrySearchModel? model) { _logger.LogInformation("ReadList. PastryName:{PastryName}.Id:{ Id} ", model?.PastryName, model?.Id); - var list = (model == null) ? _componentStorage.GetFullList() : - _componentStorage.GetFilteredList(model); + var list = (model == null) ? _pastryStorage.GetFullList() : + _pastryStorage.GetFilteredList(model); if (list == null) { _logger.LogWarning("ReadList return null list"); @@ -38,7 +38,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics } _logger.LogInformation("ReadElement. PastryName:{PastryName}.Id:{ Id}", model.PastryName, model.Id); - var element = _componentStorage.GetElement(model); + var element = _pastryStorage.GetElement(model); if (element == null) { _logger.LogWarning("ReadElement element not found"); @@ -50,7 +50,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics public bool Create(PastryBindingModel model) { CheckModel(model); - if (_componentStorage.Insert(model) == null) + if (_pastryStorage.Insert(model) == null) { _logger.LogWarning("Insert operation failed"); return false; @@ -60,7 +60,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics public bool Update(PastryBindingModel model) { CheckModel(model); - if (_componentStorage.Update(model) == null) + if (_pastryStorage.Update(model) == null) { _logger.LogWarning("Update operation failed"); return false; @@ -71,7 +71,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics { CheckModel(model, false); _logger.LogInformation("Delete. Id:{Id}", model.Id); - if (_componentStorage.Delete(model) == null) + if (_pastryStorage.Delete(model) == null) { _logger.LogWarning("Delete operation failed"); return false; @@ -99,7 +99,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics } _logger.LogInformation("Pastry. PastryName:{PastryName}.Cost:{ Cost}. Id: { Id}", model.PastryName, model.Price, model.Id); - var element = _componentStorage.GetElement(new PastrySearchModel + var element = _pastryStorage.GetElement(new PastrySearchModel { PastryName = model.PastryName });