Создание интерфейсов хранилища и логики магазина

This commit is contained in:
Данила Мочалов 2023-02-12 16:37:12 +04:00
parent a80b2b19fd
commit 5043230479
3 changed files with 34 additions and 3 deletions

View File

@ -1,4 +1,8 @@
using System;
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using LawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -6,7 +10,13 @@ using System.Threading.Tasks;
namespace LawFirmContracts.BusinessLogicContracts
{
internal interface IShopLogic
public interface IShopLogic
{
ShopViewModel? ReadElement(ShopSearchModel model);
List<ShopViewModel> ReadList(ShopSearchModel? model);
bool Create(ShopBindingModel model);
bool Update(ShopBindingModel model);
bool Delete(ShopBindingModel model);
bool SupplyDocuments(ShopSearchModel model, IDocumentModel document, int count);
}
}

View File

@ -0,0 +1,21 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.StorageContracts
{
public interface IShopStorage
{
ShopViewModel? GetElement(ShopSearchModel model);
List<ShopViewModel> GetFullList();
List<ShopViewModel> GetFilteredList(ShopSearchModel model);
ShopViewModel? Insert(ShopBindingModel model);
ShopViewModel? Update(ShopBindingModel model);
ShopViewModel? Delete(ShopBindingModel model);
}
}

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace LawFirmContracts.ViewModels
{
internal class ShopViewModel : IShopModel
public class ShopViewModel : IShopModel
{
[DisplayName("Название магазина")]
public string Name { get; set; } = string.Empty;