Business logic fix

This commit is contained in:
Илья Федотов 2024-04-30 20:15:35 +04:00
parent 0bfd5f0c6a
commit abba237b7b
3 changed files with 6 additions and 6 deletions

View File

@ -36,7 +36,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
{
CheckModel(model, false);
_logger.LogInformation($"Delete. ID:{model.ID}");
if (_storage.Insert(model) == null) {
if (_storage.Delete(model) == null) {
_logger.LogWarning("Delete operation failed");
return false;
}
@ -45,7 +45,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
public bool Update(CategoryProductBindingModel model)
{
CheckModel(model);
if (_storage.Insert(model) == null) {
if (_storage.Update(model) == null) {
_logger.LogWarning("Update operation failed");
return false;
}

View File

@ -38,7 +38,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
{
CheckModel(model, false);
_logger.LogInformation($"Delete. ID:{model.ID}");
if (_storage.Insert(model) == null)
if (_storage.Delete(model) == null)
{
_logger.LogWarning("Delete operation failed");
return false;
@ -48,7 +48,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
public bool Update(RoleBindingModel model)
{
CheckModel(model);
if (_storage.Insert(model) == null)
if (_storage.Update(model) == null)
{
_logger.LogWarning("Update operation failed");
return false;

View File

@ -38,7 +38,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
public bool Update(UserBindingModel model)
{
CheckModel(model);
if (_storage.Insert(model) == null)
if (_storage.Update(model) == null)
{
_logger.LogWarning("Update operation failed");
return false;
@ -50,7 +50,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
{
CheckModel(model, false);
_logger.LogInformation($"Delete.ID:{model.ID}");
if (_storage.Insert(model) == null)
if (_storage.Delete(model) == null)
{
_logger.LogWarning("Delete operation failes");
return false;