переименована переменная

This commit is contained in:
Данияр Аглиуллов 2023-02-05 14:26:38 +04:00
parent bac3eb0a04
commit 52ba150765

View File

@ -10,18 +10,18 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
public class PastryLogic : IPastryLogic public class PastryLogic : IPastryLogic
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IPastryStorage _componentStorage; private readonly IPastryStorage _pastryStorage;
public PastryLogic(ILogger<PastryLogic> logger, IPastryStorage componentStorage) public PastryLogic(ILogger<PastryLogic> logger, IPastryStorage pastryStorage)
{ {
_logger = logger; _logger = logger;
_componentStorage = componentStorage; _pastryStorage = pastryStorage;
} }
public List<PastryViewModel>? ReadList(PastrySearchModel? model) public List<PastryViewModel>? ReadList(PastrySearchModel? model)
{ {
_logger.LogInformation("ReadList. PastryName:{PastryName}.Id:{ Id} ", _logger.LogInformation("ReadList. PastryName:{PastryName}.Id:{ Id} ",
model?.PastryName, model?.Id); model?.PastryName, model?.Id);
var list = (model == null) ? _componentStorage.GetFullList() : var list = (model == null) ? _pastryStorage.GetFullList() :
_componentStorage.GetFilteredList(model); _pastryStorage.GetFilteredList(model);
if (list == null) if (list == null)
{ {
_logger.LogWarning("ReadList return null list"); _logger.LogWarning("ReadList return null list");
@ -38,7 +38,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
} }
_logger.LogInformation("ReadElement. PastryName:{PastryName}.Id:{ Id}", _logger.LogInformation("ReadElement. PastryName:{PastryName}.Id:{ Id}",
model.PastryName, model.Id); model.PastryName, model.Id);
var element = _componentStorage.GetElement(model); var element = _pastryStorage.GetElement(model);
if (element == null) if (element == null)
{ {
_logger.LogWarning("ReadElement element not found"); _logger.LogWarning("ReadElement element not found");
@ -50,7 +50,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
public bool Create(PastryBindingModel model) public bool Create(PastryBindingModel model)
{ {
CheckModel(model); CheckModel(model);
if (_componentStorage.Insert(model) == null) if (_pastryStorage.Insert(model) == null)
{ {
_logger.LogWarning("Insert operation failed"); _logger.LogWarning("Insert operation failed");
return false; return false;
@ -60,7 +60,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
public bool Update(PastryBindingModel model) public bool Update(PastryBindingModel model)
{ {
CheckModel(model); CheckModel(model);
if (_componentStorage.Update(model) == null) if (_pastryStorage.Update(model) == null)
{ {
_logger.LogWarning("Update operation failed"); _logger.LogWarning("Update operation failed");
return false; return false;
@ -71,7 +71,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
{ {
CheckModel(model, false); CheckModel(model, false);
_logger.LogInformation("Delete. Id:{Id}", model.Id); _logger.LogInformation("Delete. Id:{Id}", model.Id);
if (_componentStorage.Delete(model) == null) if (_pastryStorage.Delete(model) == null)
{ {
_logger.LogWarning("Delete operation failed"); _logger.LogWarning("Delete operation failed");
return false; return false;
@ -99,7 +99,7 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
} }
_logger.LogInformation("Pastry. PastryName:{PastryName}.Cost:{ Cost}. Id: { Id}", _logger.LogInformation("Pastry. PastryName:{PastryName}.Cost:{ Cost}. Id: { Id}",
model.PastryName, model.Price, model.Id); model.PastryName, model.Price, model.Id);
var element = _componentStorage.GetElement(new PastrySearchModel var element = _pastryStorage.GetElement(new PastrySearchModel
{ {
PastryName = model.PastryName PastryName = model.PastryName
}); });