Контракты done (да начнется жесть)

This commit is contained in:
Ismailov_Rovshan 2023-05-07 00:06:16 +04:00
parent ddea13b484
commit 60b97aeebb
10 changed files with 165 additions and 6 deletions

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace BlogContracts.BindingModel
{
public class NewsBindinModel : INews
public class NewsBindingModel : INews
{
public string Title { get; set; } = string.Empty;

View File

@ -6,11 +6,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="BusinessLogicContracts\" />
<Folder Include="StorageContracts\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BlogDataModels\BlogDataModels.csproj" />
</ItemGroup>

View File

@ -0,0 +1,20 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.BusinessLogicContracts
{
public interface ICommentLogic
{
List<CommentViewModel>? ReadList(CommentSearchModel? model);
CommentViewModel? ReadElement(CommentSearchModel model);
bool Create(CommentBindingModel model);
bool Update(CommentBindingModel model);
bool Delete(CommentBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.BusinessLogicContracts
{
public interface INewsLogic
{
List<NewsViewModel>? ReadList(NewsSearchModel? model);
NewsViewModel? ReadElement(NewsSearchModel model);
bool Create(NewsBindingModel model);
bool Update(NewsBindingModel model);
bool Delete(NewsBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.BusinessLogicContracts
{
public interface ITagLogic
{
List<TagViewModel>? ReadList(TagSearchModel? model);
TagViewModel? ReadElement(TagSearchModel model);
bool Create(TagBindingModel model);
bool Update(TagBindingModel model);
bool Delete(TagBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.BusinessLogicContracts
{
public interface IUserLogic
{
List<UserViewModel>? ReadList(UserSearchModel? model);
UserViewModel? ReadElement(UserSearchModel model);
bool Create(UserBindingModel model);
bool Update(UserBindingModel model);
bool Delete(UserBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.StorageContracts
{
public interface ICommentStorage
{
List<CommentViewModel> GetFullList();
List<CommentViewModel> GetFilteredList(CommentSearchModel model);
CommentViewModel? GetElement(CommentSearchModel model);
CommentViewModel? Insert(CommentBindingModel model);
CommentViewModel? Update(CommentBindingModel model);
CommentViewModel? Delete(CommentBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.StorageContracts
{
public interface INewsStorage
{
List<NewsViewModel> GetFullList();
List<NewsViewModel> GetFilteredList(NewsSearchModel model);
NewsViewModel? GetElement(NewsSearchModel model);
NewsViewModel? Insert(NewsBindingModel model);
NewsViewModel? Update(NewsBindingModel model);
NewsViewModel? Delete(NewsBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.StorageContracts
{
public interface ITagStorage
{
List<TagViewModel> GetFullList();
List<TagViewModel> GetFilteredList(TagSearchModel model);
TagViewModel? GetElement(TagSearchModel model);
TagViewModel? Insert(TagBindingModel model);
TagViewModel? Update(TagBindingModel model);
TagViewModel? Delete(TagBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using BlogContracts.BindingModel;
using BlogContracts.SearchModels;
using BlogContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BlogContracts.StorageContracts
{
public interface IUserStorage
{
List<UserViewModel> GetFullList();
List<UserViewModel> GetFilteredList(UserSearchModel model);
UserViewModel? GetElement(UserSearchModel model);
UserViewModel? Insert(UserBindingModel model);
UserViewModel? Update(UserBindingModel model);
UserViewModel? Delete(UserBindingModel model);
}
}