From 289ed32187b738013d8481e8cd8114abf8898752 Mon Sep 17 00:00:00 2001 From: Ismailov_Rovshan Date: Wed, 6 Sep 2023 20:46:57 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModel/CategoryBindingModel.cs | 16 ++++++++++ .../BindingModel/MessageBindingModel.cs | 22 +++++++++++++ .../BindingModel/RoleBindingModel.cs | 16 ++++++++++ .../BindingModel/TopicBindingModel.cs | 18 +++++++++++ .../BindingModel/UserBindingModel.cs | 24 ++++++++++++++ .../BusinessLogicContracts/ICategoryLogic.cs | 20 ++++++++++++ .../BusinessLogicContracts/IMessageLogic.cs | 23 +++++++++++++ .../BusinessLogicContracts/IRoleLogic.cs | 21 ++++++++++++ .../BusinessLogicContracts/ITopicLogic.cs | 20 ++++++++++++ .../BusinessLogicContracts/IUserLogic.cs | 21 ++++++++++++ .../SearchModels/CategorySearchModel.cs | 14 ++++++++ .../SearchModels/MessageSearchModel.cs | 14 ++++++++ .../SearchModels/RoleSearchModel.cs | 14 ++++++++ .../SearchModels/TopicSearchModel.cs | 15 +++++++++ .../SearchModels/UserSearchModel.cs | 16 ++++++++++ .../StorageContracts/ICategoryStorage.cs | 21 ++++++++++++ .../StorageContracts/IMessageStorage.cs | 24 ++++++++++++++ .../StorageContracts/IRoleStorage.cs | 22 +++++++++++++ .../StorageContracts/ITopicStorage.cs | 21 ++++++++++++ .../StorageContracts/IUserStorage.cs | 22 +++++++++++++ .../ViewModels/CategoryViewModel.cs | 18 +++++++++++ .../ViewModels/MessageViewModel.cs | 31 ++++++++++++++++++ .../BlogContracts/ViewModels/RoleViewModel.cs | 18 +++++++++++ .../ViewModels/TopicViewModel.cs | 20 ++++++++++++ .../BlogContracts/ViewModels/UserViewModel.cs | 32 +++++++++++++++++++ 25 files changed, 503 insertions(+) create mode 100644 BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs create mode 100644 BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs create mode 100644 BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs create mode 100644 BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs create mode 100644 BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs create mode 100644 BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs create mode 100644 BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs create mode 100644 BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs create mode 100644 BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs create mode 100644 BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs create mode 100644 BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs create mode 100644 BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs create mode 100644 BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs create mode 100644 BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs create mode 100644 BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs create mode 100644 BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs create mode 100644 BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs create mode 100644 BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs create mode 100644 BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs create mode 100644 BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs create mode 100644 BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs create mode 100644 BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs create mode 100644 BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs create mode 100644 BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs create mode 100644 BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs diff --git a/BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs new file mode 100644 index 0000000..f0f3649 --- /dev/null +++ b/BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs @@ -0,0 +1,16 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BindingModels +{ + public class CategoryBindingModel : ICategoryModel + { + public string Name { get; set; } = string.Empty; + + public int Id { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs new file mode 100644 index 0000000..8351c66 --- /dev/null +++ b/BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs @@ -0,0 +1,22 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BindingModels +{ + public class MessageBindingModel : IMessageModel + { + public string Text { get; set; } = string.Empty; + + public DateTime Date { get; set; } + + public int Id { get; set; } + + public int TopicId { get; set; } + + public int UserId { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs new file mode 100644 index 0000000..dc9ec5f --- /dev/null +++ b/BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs @@ -0,0 +1,16 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BindingModels +{ + public class RoleBindingModel : IRoleModel + { + public string Name { get; set; } = string.Empty; + + public int Id { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs new file mode 100644 index 0000000..e2deb6d --- /dev/null +++ b/BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs @@ -0,0 +1,18 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BindingModels +{ + public class TopicBindingModel : ITopicModel + { + public string Name { get; set; } = string.Empty; + + public int Id { get; set; } + + public int CategoryId { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs new file mode 100644 index 0000000..c62881c --- /dev/null +++ b/BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs @@ -0,0 +1,24 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BindingModels +{ + public class UserBindingModel : IUserModel + { + public string Username { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + + public DateTime RegistrationDate { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + + public int Id { get; set; } + + public int RoleId { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs new file mode 100644 index 0000000..a2faa1a --- /dev/null +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs @@ -0,0 +1,20 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BusinessLogicContracts +{ + public interface ICategoryLogic + { + List? ReadList(CategorySearchModel? model); + CategoryViewModel? ReadElement(CategorySearchModel model); + bool Create(CategoryBindingModel model); + bool Update(CategoryBindingModel model); + bool Delete(CategoryBindingModel model); + } +} diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs new file mode 100644 index 0000000..1b642df --- /dev/null +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs @@ -0,0 +1,23 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BusinessLogicContracts +{ + public interface IMessageLogic + { + List? ReadList(MessageSearchModel? model); + MessageViewModel? ReadElement(MessageSearchModel model); + bool Create(MessageBindingModel model); + bool Update(MessageBindingModel model); + bool Delete(MessageBindingModel model); + public string TestInsertList(int num, List users, List topics); + string TestReadList(int num); + string TestJoinReadList(int num); + } +} diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs new file mode 100644 index 0000000..b2596ad --- /dev/null +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs @@ -0,0 +1,21 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BusinessLogicContracts +{ + public interface IRoleLogic + { + List? ReadList(RoleSearchModel? model); + RoleViewModel? ReadElement(RoleSearchModel model); + bool Create(RoleBindingModel model); + bool Update(RoleBindingModel model); + bool Delete(RoleBindingModel model); + void RoleInsertList(int num); + } +} diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs new file mode 100644 index 0000000..aeed54a --- /dev/null +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs @@ -0,0 +1,20 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BusinessLogicContracts +{ + public interface ITopicLogic + { + List? ReadList(TopicSearchModel? model); + TopicViewModel? ReadElement(TopicSearchModel model); + bool Create(TopicBindingModel model); + bool Update(TopicBindingModel model); + bool Delete(TopicBindingModel model); + } +} diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs new file mode 100644 index 0000000..6d36dd2 --- /dev/null +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs @@ -0,0 +1,21 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.BusinessLogicContracts +{ + public interface IUserLogic + { + List? ReadList(UserSearchModel? model); + UserViewModel? ReadElement(UserSearchModel model); + bool Create(UserBindingModel model); + bool Update(UserBindingModel model); + bool Delete(UserBindingModel model); + void UserInsertList(int num, List roles); + } +} diff --git a/BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs new file mode 100644 index 0000000..c5d556e --- /dev/null +++ b/BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.SearchModels +{ + public class CategorySearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs new file mode 100644 index 0000000..49cd0df --- /dev/null +++ b/BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.SearchModels +{ + public class MessageSearchModel + { + public int? Id { get; set; } + public DateTime Date { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs new file mode 100644 index 0000000..4a2f05a --- /dev/null +++ b/BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.SearchModels +{ + public class RoleSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs new file mode 100644 index 0000000..a1700bd --- /dev/null +++ b/BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.SearchModels +{ + public class TopicSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + public int? CategoryId { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..00f1e74 --- /dev/null +++ b/BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.SearchModels +{ + public class UserSearchModel + { + public int? Id { get; set; } + public string? Username { get; set; } + public string? Email { get; set; } + + } +} diff --git a/BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs new file mode 100644 index 0000000..411d84b --- /dev/null +++ b/BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs @@ -0,0 +1,21 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.StoragesContracts +{ + public interface ICategoryStorage + { + List GetFullList(); + List GetFilteredList(CategorySearchModel model); + CategoryViewModel? GetElement(CategorySearchModel model); + CategoryViewModel? Insert(CategoryBindingModel model); + CategoryViewModel? Update(CategoryBindingModel model); + CategoryViewModel? Delete(CategoryBindingModel model); + } +} diff --git a/BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs new file mode 100644 index 0000000..9ad3261 --- /dev/null +++ b/BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs @@ -0,0 +1,24 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.StoragesContracts +{ + public interface IMessageStorage + { + List GetFullList(); + List GetFilteredList(MessageSearchModel model); + MessageViewModel? GetElement(MessageSearchModel model); + MessageViewModel? Insert(MessageBindingModel model); + MessageViewModel? Update(MessageBindingModel model); + MessageViewModel? Delete(MessageBindingModel model); + string TestInsertList(int num, List users, List topics); + string TestReadList(int num); + string TestJoinReadList(int num); + } +} diff --git a/BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs new file mode 100644 index 0000000..4a98375 --- /dev/null +++ b/BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs @@ -0,0 +1,22 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.StoragesContracts +{ + public interface IRoleStorage + { + List GetFullList(); + List GetFilteredList(RoleSearchModel model); + RoleViewModel? GetElement(RoleSearchModel model); + RoleViewModel? Insert(RoleBindingModel model); + RoleViewModel? Update(RoleBindingModel model); + RoleViewModel? Delete(RoleBindingModel model); + void RoleInsertList(int num); + } +} diff --git a/BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs new file mode 100644 index 0000000..0aeebc7 --- /dev/null +++ b/BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs @@ -0,0 +1,21 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.StoragesContracts +{ + public interface ITopicStorage + { + List GetFullList(); + List GetFilteredList(TopicSearchModel model); + TopicViewModel? GetElement(TopicSearchModel model); + TopicViewModel? Insert(TopicBindingModel model); + TopicViewModel? Update(TopicBindingModel model); + TopicViewModel? Delete(TopicBindingModel model); + } +} diff --git a/BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs new file mode 100644 index 0000000..795d393 --- /dev/null +++ b/BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs @@ -0,0 +1,22 @@ +using ForumContracts.BindingModels; +using ForumContracts.SearchModels; +using ForumContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.StoragesContracts +{ + public interface IUserStorage + { + List GetFullList(); + List GetFilteredList(UserSearchModel model); + UserViewModel? GetElement(UserSearchModel model); + UserViewModel? Insert(UserBindingModel model); + UserViewModel? Update(UserBindingModel model); + UserViewModel? Delete(UserBindingModel model); + void UserInsertList(int num, List roles); + } +} diff --git a/BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs new file mode 100644 index 0000000..7a9df09 --- /dev/null +++ b/BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs @@ -0,0 +1,18 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.ViewModels +{ + public class CategoryViewModel : ICategoryModel + { + [DisplayName("Название категории")] + public string Name { get; set; } = string.Empty; + + public int Id { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs new file mode 100644 index 0000000..6f548b5 --- /dev/null +++ b/BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs @@ -0,0 +1,31 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.ViewModels +{ + public class MessageViewModel : IMessageModel + { + public int UserId { get; set; } + + [DisplayName("Пользователь")] + public string Username { get; set; } = string.Empty; + + public int TopicId { get; set; } + + [DisplayName("Название темы")] + public string TopicName { get; set; } = string.Empty; + + [DisplayName("Текст сообщения")] + public string Text { get; set; } = string.Empty; + + [DisplayName("Дата написания сообщения")] + public DateTime Date { get; set; } + + public int Id { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs new file mode 100644 index 0000000..5caa2de --- /dev/null +++ b/BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs @@ -0,0 +1,18 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.ViewModels +{ + public class RoleViewModel : IRoleModel + { + [DisplayName("Название роли")] + public string Name { get; set; } = string.Empty; + + public int Id { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs new file mode 100644 index 0000000..4266b24 --- /dev/null +++ b/BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs @@ -0,0 +1,20 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.ViewModels +{ + public class TopicViewModel : ITopicModel + { + [DisplayName("Название темы")] + public string Name { get; set; } = string.Empty; + + public int Id { get; set; } + + public int CategoryId { get; set; } + } +} diff --git a/BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs new file mode 100644 index 0000000..28ff39a --- /dev/null +++ b/BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs @@ -0,0 +1,32 @@ +using ForumDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ForumContracts.ViewModels +{ + public class UserViewModel : IUserModel + { + [DisplayName("Имя")] + public string Username { get; set; } = string.Empty; + + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + + [DisplayName("Дата регистрации")] + public DateTime RegistrationDate { get; set; } + + public int Id { get; set; } + + public int RoleId { get; set; } + + [DisplayName("Роль")] + public string RoleName { get; set; } = string.Empty; + } +}