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

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
{
private readonly ILogger _logger;
private readonly IPastryStorage _componentStorage;
public PastryLogic(ILogger<PastryLogic> logger, IPastryStorage componentStorage)
private readonly IPastryStorage _pastryStorage;
public PastryLogic(ILogger<PastryLogic> logger, IPastryStorage pastryStorage)
{
_logger = logger;
_componentStorage = componentStorage;
_pastryStorage = pastryStorage;
}
public List<PastryViewModel>? 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
});