From 973dffc3b30462edcb33362b6f72ac67b4983236 Mon Sep 17 00:00:00 2001 From: Ismailov_Rovshan Date: Wed, 6 Sep 2023 22:02:39 +0400 Subject: [PATCH] fix --- .../BindingModel/CategoryBindingModel.cs | 4 +- .../BindingModel/MessageBindingModel.cs | 4 +- .../BindingModel/RoleBindingModel.cs | 4 +- .../BindingModel/TopicBindingModel.cs | 4 +- .../BindingModel/UserBindingModel.cs | 4 +- .../BusinessLogicContracts/ICategoryLogic.cs | 8 +- .../BusinessLogicContracts/IMessageLogic.cs | 8 +- .../BusinessLogicContracts/IRoleLogic.cs | 8 +- .../BusinessLogicContracts/ITopicLogic.cs | 8 +- .../BusinessLogicContracts/IUserLogic.cs | 8 +- .../SearchModels/CategorySearchModel.cs | 2 +- .../SearchModels/MessageSearchModel.cs | 2 +- .../SearchModels/RoleSearchModel.cs | 2 +- .../SearchModels/TopicSearchModel.cs | 2 +- .../SearchModels/UserSearchModel.cs | 2 +- .../StorageContracts/ICategoryStorage.cs | 8 +- .../StorageContracts/IMessageStorage.cs | 8 +- .../StorageContracts/IRoleStorage.cs | 8 +- .../StorageContracts/ITopicStorage.cs | 8 +- .../StorageContracts/IUserStorage.cs | 8 +- .../ViewModels/CategoryViewModel.cs | 4 +- .../ViewModels/MessageViewModel.cs | 4 +- .../BlogContracts/ViewModels/RoleViewModel.cs | 4 +- .../ViewModels/TopicViewModel.cs | 4 +- .../BlogContracts/ViewModels/UserViewModel.cs | 4 +- BlogDataModels/BlogDataModels.sln | 4 +- .../BlogDataModels/ICategoryModel.cs | 2 +- BlogDataModels/BlogDataModels/IId.cs | 2 +- .../BlogDataModels/IMessageModel.cs | 2 +- BlogDataModels/BlogDataModels/IRoleModel.cs | 2 +- BlogDataModels/BlogDataModels/ITopicModel.cs | 2 +- BlogDataModels/BlogDataModels/IUserModel.cs | 2 +- .../BlogDatabaseImplement/BlogDatabase.cs | 9 +- ...seImplement.csproj => BlogDatabase.csproj} | 0 .../Implements/CategoryStorage.cs | 8 +- .../Implements/MessageStorage.cs | 8 +- .../Implements/RoleStorage.cs | 8 +- .../Implements/TopicStorage.cs | 8 +- .../Implements/UserStorage.cs | 8 +- .../20230906180114_mig4.Designer.cs | 196 ++++++++++++++++++ .../Migrations/20230906180114_mig4.cs | 154 ++++++++++++++ .../Migrations/BlogDatabaseModelSnapshot.cs | 193 +++++++++++++++++ .../BlogDatabaseImplement/Model/Category.cs | 6 +- .../BlogDatabaseImplement/Model/Message.cs | 6 +- .../BlogDatabaseImplement/Model/Role.cs | 6 +- .../BlogDatabaseImplement/Model/Topic.cs | 6 +- .../BlogDatabaseImplement/Model/User.cs | 6 +- .../BlogViewModel/BlogViewModel.csproj | 2 +- .../BlogViewModel/FormAddTopic.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormAddTopic.cs | 6 +- .../BlogViewModel/FormAddTopics.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormAddTopics.cs | 8 +- .../BlogViewModel/FormCategories.Designer.cs | 2 +- .../BlogViewModel/FormCategories.cs | 6 +- .../BlogViewModel/FormCategory.Designer.cs | 4 +- BlogDataModels/BlogViewModel/FormCategory.cs | 8 +- .../FormCreateMessage.Designer.cs | 2 +- .../BlogViewModel/FormCreateMessage.cs | 10 +- .../BlogViewModel/FormMain.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormMain.cs | 8 +- .../BlogViewModel/FormRole.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormRole.cs | 8 +- .../BlogViewModel/FormRoles.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormRoles.cs | 6 +- .../BlogViewModel/FormTests.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormTests.cs | 4 +- .../BlogViewModel/FormUser.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormUser.cs | 8 +- .../BlogViewModel/FormUsers.Designer.cs | 2 +- BlogDataModels/BlogViewModel/FormUsers.cs | 8 +- BlogDataModels/BlogViewModel/Program.cs | 8 +- BlogDataModels/BusinessLogic/CategoryLogic.cs | 12 +- BlogDataModels/BusinessLogic/MessageLogic.cs | 12 +- BlogDataModels/BusinessLogic/RoleLogic.cs | 12 +- BlogDataModels/BusinessLogic/TopicLogic.cs | 12 +- BlogDataModels/BusinessLogic/UserLogic.cs | 12 +- 76 files changed, 742 insertions(+), 200 deletions(-) rename BlogDataModels/BlogDatabaseImplement/{BlogDatabaseImplement.csproj => BlogDatabase.csproj} (100%) create mode 100644 BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.Designer.cs create mode 100644 BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.cs create mode 100644 BlogDataModels/BlogDatabaseImplement/Migrations/BlogDatabaseModelSnapshot.cs diff --git a/BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs index f0f3649..2690be7 100644 --- a/BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs +++ b/BlogDataModels/BlogContracts/BindingModel/CategoryBindingModel.cs @@ -1,11 +1,11 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BindingModels +namespace BlogContracts.BindingModels { public class CategoryBindingModel : ICategoryModel { diff --git a/BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs index 8351c66..4cf1b5b 100644 --- a/BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs +++ b/BlogDataModels/BlogContracts/BindingModel/MessageBindingModel.cs @@ -1,11 +1,11 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BindingModels +namespace BlogContracts.BindingModels { public class MessageBindingModel : IMessageModel { diff --git a/BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs index dc9ec5f..9cb96a0 100644 --- a/BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs +++ b/BlogDataModels/BlogContracts/BindingModel/RoleBindingModel.cs @@ -1,11 +1,11 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BindingModels +namespace BlogContracts.BindingModels { public class RoleBindingModel : IRoleModel { diff --git a/BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs index e2deb6d..347f25b 100644 --- a/BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs +++ b/BlogDataModels/BlogContracts/BindingModel/TopicBindingModel.cs @@ -1,11 +1,11 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BindingModels +namespace BlogContracts.BindingModels { public class TopicBindingModel : ITopicModel { diff --git a/BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs b/BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs index c62881c..608cdf2 100644 --- a/BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs +++ b/BlogDataModels/BlogContracts/BindingModel/UserBindingModel.cs @@ -1,11 +1,11 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BindingModels +namespace BlogContracts.BindingModels { public class UserBindingModel : IUserModel { diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs index a2faa1a..63aa6b9 100644 --- a/BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/ICategoryLogic.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BusinessLogicContracts +namespace BlogContracts.BusinessLogicContracts { public interface ICategoryLogic { diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs index 1b642df..501fbfe 100644 --- a/BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/IMessageLogic.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BusinessLogicContracts +namespace BlogContracts.BusinessLogicContracts { public interface IMessageLogic { diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs index b2596ad..76023be 100644 --- a/BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/IRoleLogic.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BusinessLogicContracts +namespace BlogContracts.BusinessLogicContracts { public interface IRoleLogic { diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs index aeed54a..117130b 100644 --- a/BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/ITopicLogic.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BusinessLogicContracts +namespace BlogContracts.BusinessLogicContracts { public interface ITopicLogic { diff --git a/BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs b/BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs index 6d36dd2..88d25fc 100644 --- a/BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs +++ b/BlogDataModels/BlogContracts/BusinessLogicContracts/IUserLogic.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.BusinessLogicContracts +namespace BlogContracts.BusinessLogicContracts { public interface IUserLogic { diff --git a/BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs index c5d556e..83490c8 100644 --- a/BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs +++ b/BlogDataModels/BlogContracts/SearchModels/CategorySearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.SearchModels +namespace BlogContracts.SearchModels { public class CategorySearchModel { diff --git a/BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs index 49cd0df..712424c 100644 --- a/BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs +++ b/BlogDataModels/BlogContracts/SearchModels/MessageSearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.SearchModels +namespace BlogContracts.SearchModels { public class MessageSearchModel { diff --git a/BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs index 4a2f05a..e742883 100644 --- a/BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs +++ b/BlogDataModels/BlogContracts/SearchModels/RoleSearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.SearchModels +namespace BlogContracts.SearchModels { public class RoleSearchModel { diff --git a/BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs index a1700bd..6b803f8 100644 --- a/BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs +++ b/BlogDataModels/BlogContracts/SearchModels/TopicSearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.SearchModels +namespace BlogContracts.SearchModels { public class TopicSearchModel { diff --git a/BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs b/BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs index 00f1e74..466f806 100644 --- a/BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs +++ b/BlogDataModels/BlogContracts/SearchModels/UserSearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.SearchModels +namespace BlogContracts.SearchModels { public class UserSearchModel { diff --git a/BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs index 411d84b..0f7eb5d 100644 --- a/BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs +++ b/BlogDataModels/BlogContracts/StorageContracts/ICategoryStorage.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.StoragesContracts +namespace BlogContracts.StoragesContracts { public interface ICategoryStorage { diff --git a/BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs index 9ad3261..cae7a88 100644 --- a/BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs +++ b/BlogDataModels/BlogContracts/StorageContracts/IMessageStorage.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.StoragesContracts +namespace BlogContracts.StoragesContracts { public interface IMessageStorage { diff --git a/BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs index 4a98375..ba6c77c 100644 --- a/BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs +++ b/BlogDataModels/BlogContracts/StorageContracts/IRoleStorage.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.StoragesContracts +namespace BlogContracts.StoragesContracts { public interface IRoleStorage { diff --git a/BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs index 0aeebc7..7ae7435 100644 --- a/BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs +++ b/BlogDataModels/BlogContracts/StorageContracts/ITopicStorage.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.StoragesContracts +namespace BlogContracts.StoragesContracts { public interface ITopicStorage { diff --git a/BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs b/BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs index 795d393..71ea669 100644 --- a/BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs +++ b/BlogDataModels/BlogContracts/StorageContracts/IUserStorage.cs @@ -1,13 +1,13 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.StoragesContracts +namespace BlogContracts.StoragesContracts { public interface IUserStorage { diff --git a/BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs index 7a9df09..e5d0055 100644 --- a/BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs +++ b/BlogDataModels/BlogContracts/ViewModels/CategoryViewModel.cs @@ -1,4 +1,4 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.ViewModels +namespace BlogContracts.ViewModels { public class CategoryViewModel : ICategoryModel { diff --git a/BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs index 6f548b5..0808b08 100644 --- a/BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs +++ b/BlogDataModels/BlogContracts/ViewModels/MessageViewModel.cs @@ -1,4 +1,4 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.ViewModels +namespace BlogContracts.ViewModels { public class MessageViewModel : IMessageModel { diff --git a/BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs index 5caa2de..6611d45 100644 --- a/BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs +++ b/BlogDataModels/BlogContracts/ViewModels/RoleViewModel.cs @@ -1,4 +1,4 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.ViewModels +namespace BlogContracts.ViewModels { public class RoleViewModel : IRoleModel { diff --git a/BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs index 4266b24..4d92f2c 100644 --- a/BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs +++ b/BlogDataModels/BlogContracts/ViewModels/TopicViewModel.cs @@ -1,4 +1,4 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.ViewModels +namespace BlogContracts.ViewModels { public class TopicViewModel : ITopicModel { diff --git a/BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs b/BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs index 28ff39a..24c6cd3 100644 --- a/BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs +++ b/BlogDataModels/BlogContracts/ViewModels/UserViewModel.cs @@ -1,4 +1,4 @@ -using ForumDataModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumContracts.ViewModels +namespace BlogContracts.ViewModels { public class UserViewModel : IUserModel { diff --git a/BlogDataModels/BlogDataModels.sln b/BlogDataModels/BlogDataModels.sln index 943b759..4548675 100644 --- a/BlogDataModels/BlogDataModels.sln +++ b/BlogDataModels/BlogDataModels.sln @@ -9,9 +9,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlogContracts", "BlogContra EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BusinessLogic", "BusinessLogic\BusinessLogic.csproj", "{7A56C58F-F558-48D7-92A1-07D02E3B2387}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlogDatabaseImplement", "BlogDatabaseImplement\BlogDatabaseImplement.csproj", "{EFBA4215-0B0B-4302-9465-89C723F9D975}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlogDatabase", "BlogDatabaseImplement\BlogDatabase.csproj", "{EFBA4215-0B0B-4302-9465-89C723F9D975}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlogViewModel", "BlogViewModel\BlogViewModel.csproj", "{584E2CE9-1804-4A16-AA82-EED3F84531AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlogViewModel", "BlogViewModel\BlogViewModel.csproj", "{584E2CE9-1804-4A16-AA82-EED3F84531AC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/BlogDataModels/BlogDataModels/ICategoryModel.cs b/BlogDataModels/BlogDataModels/ICategoryModel.cs index 64a9363..cf78721 100644 --- a/BlogDataModels/BlogDataModels/ICategoryModel.cs +++ b/BlogDataModels/BlogDataModels/ICategoryModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumDataModels +namespace BlogDataModels { public interface ICategoryModel : IId { diff --git a/BlogDataModels/BlogDataModels/IId.cs b/BlogDataModels/BlogDataModels/IId.cs index 34c0a00..3cb15f2 100644 --- a/BlogDataModels/BlogDataModels/IId.cs +++ b/BlogDataModels/BlogDataModels/IId.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumDataModels +namespace BlogDataModels { public interface IId { diff --git a/BlogDataModels/BlogDataModels/IMessageModel.cs b/BlogDataModels/BlogDataModels/IMessageModel.cs index 5c4046e..44fc7d5 100644 --- a/BlogDataModels/BlogDataModels/IMessageModel.cs +++ b/BlogDataModels/BlogDataModels/IMessageModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumDataModels +namespace BlogDataModels { public interface IMessageModel : IId { diff --git a/BlogDataModels/BlogDataModels/IRoleModel.cs b/BlogDataModels/BlogDataModels/IRoleModel.cs index 43ea585..48dc371 100644 --- a/BlogDataModels/BlogDataModels/IRoleModel.cs +++ b/BlogDataModels/BlogDataModels/IRoleModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumDataModels +namespace BlogDataModels { public interface IRoleModel : IId { diff --git a/BlogDataModels/BlogDataModels/ITopicModel.cs b/BlogDataModels/BlogDataModels/ITopicModel.cs index 4f8f2a2..424d78b 100644 --- a/BlogDataModels/BlogDataModels/ITopicModel.cs +++ b/BlogDataModels/BlogDataModels/ITopicModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumDataModels +namespace BlogDataModels { public interface ITopicModel : IId { diff --git a/BlogDataModels/BlogDataModels/IUserModel.cs b/BlogDataModels/BlogDataModels/IUserModel.cs index 063e21b..7e1aff8 100644 --- a/BlogDataModels/BlogDataModels/IUserModel.cs +++ b/BlogDataModels/BlogDataModels/IUserModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumDataModels +namespace BlogDataModels { public interface IUserModel : IId { diff --git a/BlogDataModels/BlogDatabaseImplement/BlogDatabase.cs b/BlogDataModels/BlogDatabaseImplement/BlogDatabase.cs index 250db81..f64ee12 100644 --- a/BlogDataModels/BlogDatabaseImplement/BlogDatabase.cs +++ b/BlogDataModels/BlogDatabaseImplement/BlogDatabase.cs @@ -1,13 +1,12 @@ -using Microsoft.EntityFrameworkCore; +using BlogDatabase.Models; +using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.ComponentModel; -using BlogDatabase.Models; -namespace BlogDatabaseImplement +namespace BlogDatabase { public class BlogDatabase : DbContext { @@ -15,7 +14,7 @@ namespace BlogDatabaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=ForumSubd;Username=postgres;Password=postgres"); + optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=BlogSubd;Username=postgres;Password=postgres"); } base.OnConfiguring(optionsBuilder); } diff --git a/BlogDataModels/BlogDatabaseImplement/BlogDatabaseImplement.csproj b/BlogDataModels/BlogDatabaseImplement/BlogDatabase.csproj similarity index 100% rename from BlogDataModels/BlogDatabaseImplement/BlogDatabaseImplement.csproj rename to BlogDataModels/BlogDatabaseImplement/BlogDatabase.csproj diff --git a/BlogDataModels/BlogDatabaseImplement/Implements/CategoryStorage.cs b/BlogDataModels/BlogDatabaseImplement/Implements/CategoryStorage.cs index 366ea38..a30936c 100644 --- a/BlogDataModels/BlogDatabaseImplement/Implements/CategoryStorage.cs +++ b/BlogDataModels/BlogDatabaseImplement/Implements/CategoryStorage.cs @@ -1,7 +1,7 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using BlogDatabase.Models; using System; using System.Collections.Generic; diff --git a/BlogDataModels/BlogDatabaseImplement/Implements/MessageStorage.cs b/BlogDataModels/BlogDatabaseImplement/Implements/MessageStorage.cs index 9096be8..4e78efd 100644 --- a/BlogDataModels/BlogDatabaseImplement/Implements/MessageStorage.cs +++ b/BlogDataModels/BlogDatabaseImplement/Implements/MessageStorage.cs @@ -1,7 +1,7 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using BlogDatabase.Models; using Microsoft.EntityFrameworkCore; using System; diff --git a/BlogDataModels/BlogDatabaseImplement/Implements/RoleStorage.cs b/BlogDataModels/BlogDatabaseImplement/Implements/RoleStorage.cs index 57337ec..1b61de8 100644 --- a/BlogDataModels/BlogDatabaseImplement/Implements/RoleStorage.cs +++ b/BlogDataModels/BlogDatabaseImplement/Implements/RoleStorage.cs @@ -1,7 +1,7 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using BlogDatabase.Models; using System; using System.Collections.Generic; diff --git a/BlogDataModels/BlogDatabaseImplement/Implements/TopicStorage.cs b/BlogDataModels/BlogDatabaseImplement/Implements/TopicStorage.cs index 2e2c988..968866b 100644 --- a/BlogDataModels/BlogDatabaseImplement/Implements/TopicStorage.cs +++ b/BlogDataModels/BlogDatabaseImplement/Implements/TopicStorage.cs @@ -1,7 +1,7 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using BlogDatabase.Models; using Microsoft.EntityFrameworkCore; using System; diff --git a/BlogDataModels/BlogDatabaseImplement/Implements/UserStorage.cs b/BlogDataModels/BlogDatabaseImplement/Implements/UserStorage.cs index 2990b9a..0a674c1 100644 --- a/BlogDataModels/BlogDatabaseImplement/Implements/UserStorage.cs +++ b/BlogDataModels/BlogDatabaseImplement/Implements/UserStorage.cs @@ -1,7 +1,7 @@ -using ForumContracts.BindingModels; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using BlogDatabase.Models; using Microsoft.EntityFrameworkCore; using System; diff --git a/BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.Designer.cs b/BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.Designer.cs new file mode 100644 index 0000000..0e435bb --- /dev/null +++ b/BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.Designer.cs @@ -0,0 +1,196 @@ +// +using System; +using BlogDatabase; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace BlogDatabase.Migrations +{ + [DbContext(typeof(BlogDatabase))] + [Migration("20230906180114_mig4")] + partial class mig4 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("BlogDatabase.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("Text") + .IsRequired() + .HasColumnType("text"); + + b.Property("TopicId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TopicId"); + + b.HasIndex("UserId"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Topic", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Topics"); + }); + + modelBuilder.Entity("BlogDatabase.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("RegistrationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("Username") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Message", b => + { + b.HasOne("BlogDatabase.Models.Topic", "Topic") + .WithMany() + .HasForeignKey("TopicId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BlogDatabase.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Topic"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Topic", b => + { + b.HasOne("BlogDatabase.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("BlogDatabase.Models.User", b => + { + b.HasOne("BlogDatabase.Models.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.cs b/BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.cs new file mode 100644 index 0000000..8fecb70 --- /dev/null +++ b/BlogDataModels/BlogDatabaseImplement/Migrations/20230906180114_mig4.cs @@ -0,0 +1,154 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace BlogDatabase.Migrations +{ + /// + public partial class mig4 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Categories", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false), + UserId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Categories", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Roles", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Roles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Topics", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false), + UserId = table.Column(type: "integer", nullable: false), + CategoryId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Topics", x => x.Id); + table.ForeignKey( + name: "FK_Topics_Categories_CategoryId", + column: x => x.CategoryId, + principalTable: "Categories", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Username = table.Column(type: "text", nullable: false), + Email = table.Column(type: "text", nullable: false), + Password = table.Column(type: "text", nullable: false), + RegistrationDate = table.Column(type: "timestamp with time zone", nullable: false), + RoleId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + table.ForeignKey( + name: "FK_Users_Roles_RoleId", + column: x => x.RoleId, + principalTable: "Roles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Messages", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Text = table.Column(type: "text", nullable: false), + Date = table.Column(type: "timestamp with time zone", nullable: false), + UserId = table.Column(type: "integer", nullable: false), + TopicId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Messages", x => x.Id); + table.ForeignKey( + name: "FK_Messages_Topics_TopicId", + column: x => x.TopicId, + principalTable: "Topics", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Messages_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Messages_TopicId", + table: "Messages", + column: "TopicId"); + + migrationBuilder.CreateIndex( + name: "IX_Messages_UserId", + table: "Messages", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Topics_CategoryId", + table: "Topics", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_RoleId", + table: "Users", + column: "RoleId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Messages"); + + migrationBuilder.DropTable( + name: "Topics"); + + migrationBuilder.DropTable( + name: "Users"); + + migrationBuilder.DropTable( + name: "Categories"); + + migrationBuilder.DropTable( + name: "Roles"); + } + } +} diff --git a/BlogDataModels/BlogDatabaseImplement/Migrations/BlogDatabaseModelSnapshot.cs b/BlogDataModels/BlogDatabaseImplement/Migrations/BlogDatabaseModelSnapshot.cs new file mode 100644 index 0000000..20bde47 --- /dev/null +++ b/BlogDataModels/BlogDatabaseImplement/Migrations/BlogDatabaseModelSnapshot.cs @@ -0,0 +1,193 @@ +// +using System; +using BlogDatabase; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace BlogDatabase.Migrations +{ + [DbContext(typeof(BlogDatabase))] + partial class BlogDatabaseModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("BlogDatabase.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("Text") + .IsRequired() + .HasColumnType("text"); + + b.Property("TopicId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TopicId"); + + b.HasIndex("UserId"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Topic", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CategoryId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Topics"); + }); + + modelBuilder.Entity("BlogDatabase.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("RegistrationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RoleId") + .HasColumnType("integer"); + + b.Property("Username") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Message", b => + { + b.HasOne("BlogDatabase.Models.Topic", "Topic") + .WithMany() + .HasForeignKey("TopicId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BlogDatabase.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Topic"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BlogDatabase.Models.Topic", b => + { + b.HasOne("BlogDatabase.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("BlogDatabase.Models.User", b => + { + b.HasOne("BlogDatabase.Models.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BlogDataModels/BlogDatabaseImplement/Model/Category.cs b/BlogDataModels/BlogDatabaseImplement/Model/Category.cs index 2a76f5a..c382866 100644 --- a/BlogDataModels/BlogDatabaseImplement/Model/Category.cs +++ b/BlogDataModels/BlogDatabaseImplement/Model/Category.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.ViewModels; -using ForumDataModels; +using BlogContracts.BindingModels; +using BlogContracts.ViewModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/BlogDataModels/BlogDatabaseImplement/Model/Message.cs b/BlogDataModels/BlogDatabaseImplement/Model/Message.cs index 182cff9..f3a2c6c 100644 --- a/BlogDataModels/BlogDatabaseImplement/Model/Message.cs +++ b/BlogDataModels/BlogDatabaseImplement/Model/Message.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.ViewModels; -using ForumDataModels; +using BlogContracts.BindingModels; +using BlogContracts.ViewModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/BlogDataModels/BlogDatabaseImplement/Model/Role.cs b/BlogDataModels/BlogDatabaseImplement/Model/Role.cs index 211a5cd..b7eba61 100644 --- a/BlogDataModels/BlogDatabaseImplement/Model/Role.cs +++ b/BlogDataModels/BlogDatabaseImplement/Model/Role.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.ViewModels; -using ForumDataModels; +using BlogContracts.BindingModels; +using BlogContracts.ViewModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/BlogDataModels/BlogDatabaseImplement/Model/Topic.cs b/BlogDataModels/BlogDatabaseImplement/Model/Topic.cs index d3cf68c..b9f5024 100644 --- a/BlogDataModels/BlogDatabaseImplement/Model/Topic.cs +++ b/BlogDataModels/BlogDatabaseImplement/Model/Topic.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.ViewModels; -using ForumDataModels; +using BlogContracts.BindingModels; +using BlogContracts.ViewModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/BlogDataModels/BlogDatabaseImplement/Model/User.cs b/BlogDataModels/BlogDatabaseImplement/Model/User.cs index c8a9d96..0cdd8ab 100644 --- a/BlogDataModels/BlogDatabaseImplement/Model/User.cs +++ b/BlogDataModels/BlogDatabaseImplement/Model/User.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.ViewModels; -using ForumDataModels; +using BlogContracts.BindingModels; +using BlogContracts.ViewModels; +using BlogDataModels; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/BlogDataModels/BlogViewModel/BlogViewModel.csproj b/BlogDataModels/BlogViewModel/BlogViewModel.csproj index 2d239b4..adb2455 100644 --- a/BlogDataModels/BlogViewModel/BlogViewModel.csproj +++ b/BlogDataModels/BlogViewModel/BlogViewModel.csproj @@ -18,7 +18,7 @@ - + diff --git a/BlogDataModels/BlogViewModel/FormAddTopic.Designer.cs b/BlogDataModels/BlogViewModel/FormAddTopic.Designer.cs index ff1e157..2e19c83 100644 --- a/BlogDataModels/BlogViewModel/FormAddTopic.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormAddTopic.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormAddTopic { diff --git a/BlogDataModels/BlogViewModel/FormAddTopic.cs b/BlogDataModels/BlogViewModel/FormAddTopic.cs index 8d6158a..4b69b6d 100644 --- a/BlogDataModels/BlogViewModel/FormAddTopic.cs +++ b/BlogDataModels/BlogViewModel/FormAddTopic.cs @@ -1,5 +1,5 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,7 +10,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormAddTopic : Form { diff --git a/BlogDataModels/BlogViewModel/FormAddTopics.Designer.cs b/BlogDataModels/BlogViewModel/FormAddTopics.Designer.cs index 3c91076..1774ffa 100644 --- a/BlogDataModels/BlogViewModel/FormAddTopics.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormAddTopics.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormAddTopics { diff --git a/BlogDataModels/BlogViewModel/FormAddTopics.cs b/BlogDataModels/BlogViewModel/FormAddTopics.cs index 43347fd..64ef99c 100644 --- a/BlogDataModels/BlogViewModel/FormAddTopics.cs +++ b/BlogDataModels/BlogViewModel/FormAddTopics.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -11,7 +11,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormAddTopics : Form { diff --git a/BlogDataModels/BlogViewModel/FormCategories.Designer.cs b/BlogDataModels/BlogViewModel/FormCategories.Designer.cs index 6eb83b5..b88b687 100644 --- a/BlogDataModels/BlogViewModel/FormCategories.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormCategories.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormCategories { diff --git a/BlogDataModels/BlogViewModel/FormCategories.cs b/BlogDataModels/BlogViewModel/FormCategories.cs index afcee17..0509b8c 100644 --- a/BlogDataModels/BlogViewModel/FormCategories.cs +++ b/BlogDataModels/BlogViewModel/FormCategories.cs @@ -1,5 +1,5 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,7 +10,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormCategories : Form { diff --git a/BlogDataModels/BlogViewModel/FormCategory.Designer.cs b/BlogDataModels/BlogViewModel/FormCategory.Designer.cs index b27e7bc..a08f1ca 100644 --- a/BlogDataModels/BlogViewModel/FormCategory.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormCategory.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormCategory { @@ -9,7 +9,7 @@ /// /// Clean up any resources being used. - /// + /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { diff --git a/BlogDataModels/BlogViewModel/FormCategory.cs b/BlogDataModels/BlogViewModel/FormCategory.cs index d436f7e..1ada045 100644 --- a/BlogDataModels/BlogViewModel/FormCategory.cs +++ b/BlogDataModels/BlogViewModel/FormCategory.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -11,7 +11,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormCategory : Form { diff --git a/BlogDataModels/BlogViewModel/FormCreateMessage.Designer.cs b/BlogDataModels/BlogViewModel/FormCreateMessage.Designer.cs index 420c8b6..13c90d2 100644 --- a/BlogDataModels/BlogViewModel/FormCreateMessage.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormCreateMessage.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormCreateMessage { diff --git a/BlogDataModels/BlogViewModel/FormCreateMessage.cs b/BlogDataModels/BlogViewModel/FormCreateMessage.cs index d1e43a3..617b2b8 100644 --- a/BlogDataModels/BlogViewModel/FormCreateMessage.cs +++ b/BlogDataModels/BlogViewModel/FormCreateMessage.cs @@ -1,7 +1,7 @@ -using ForumBusinessLogic; -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; +using BlogBusinessLogic; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -12,7 +12,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormCreateMessage : Form { diff --git a/BlogDataModels/BlogViewModel/FormMain.Designer.cs b/BlogDataModels/BlogViewModel/FormMain.Designer.cs index 917641f..628f208 100644 --- a/BlogDataModels/BlogViewModel/FormMain.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormMain.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormMain { diff --git a/BlogDataModels/BlogViewModel/FormMain.cs b/BlogDataModels/BlogViewModel/FormMain.cs index f131a73..34d5128 100644 --- a/BlogDataModels/BlogViewModel/FormMain.cs +++ b/BlogDataModels/BlogViewModel/FormMain.cs @@ -1,9 +1,9 @@ -using ForumBusinessLogic; -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; +using BlogBusinessLogic; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormMain : Form { diff --git a/BlogDataModels/BlogViewModel/FormRole.Designer.cs b/BlogDataModels/BlogViewModel/FormRole.Designer.cs index 0f47b2b..5c93ba4 100644 --- a/BlogDataModels/BlogViewModel/FormRole.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormRole.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormRole { diff --git a/BlogDataModels/BlogViewModel/FormRole.cs b/BlogDataModels/BlogViewModel/FormRole.cs index c68b74e..e8fa6df 100644 --- a/BlogDataModels/BlogViewModel/FormRole.cs +++ b/BlogDataModels/BlogViewModel/FormRole.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; using Microsoft.EntityFrameworkCore.Diagnostics; using System; using System.Collections.Generic; @@ -12,7 +12,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormRole : Form { diff --git a/BlogDataModels/BlogViewModel/FormRoles.Designer.cs b/BlogDataModels/BlogViewModel/FormRoles.Designer.cs index a0fbea4..e114840 100644 --- a/BlogDataModels/BlogViewModel/FormRoles.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormRoles.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormRoles { diff --git a/BlogDataModels/BlogViewModel/FormRoles.cs b/BlogDataModels/BlogViewModel/FormRoles.cs index 7c969c1..08b9097 100644 --- a/BlogDataModels/BlogViewModel/FormRoles.cs +++ b/BlogDataModels/BlogViewModel/FormRoles.cs @@ -1,5 +1,5 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,7 +10,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormRoles : Form { diff --git a/BlogDataModels/BlogViewModel/FormTests.Designer.cs b/BlogDataModels/BlogViewModel/FormTests.Designer.cs index 5252f3a..2d4a13a 100644 --- a/BlogDataModels/BlogViewModel/FormTests.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormTests.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormTests { diff --git a/BlogDataModels/BlogViewModel/FormTests.cs b/BlogDataModels/BlogViewModel/FormTests.cs index f182f51..f638d58 100644 --- a/BlogDataModels/BlogViewModel/FormTests.cs +++ b/BlogDataModels/BlogViewModel/FormTests.cs @@ -1,4 +1,4 @@ -using ForumContracts.BusinessLogicContracts; +using BlogContracts.BusinessLogicContracts; using System; using System.Collections.Generic; using System.ComponentModel; @@ -9,7 +9,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormTests : Form { diff --git a/BlogDataModels/BlogViewModel/FormUser.Designer.cs b/BlogDataModels/BlogViewModel/FormUser.Designer.cs index 5b62c92..7218996 100644 --- a/BlogDataModels/BlogViewModel/FormUser.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormUser.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormUser { diff --git a/BlogDataModels/BlogViewModel/FormUser.cs b/BlogDataModels/BlogViewModel/FormUser.cs index c543243..bd767d1 100644 --- a/BlogDataModels/BlogViewModel/FormUser.cs +++ b/BlogDataModels/BlogViewModel/FormUser.cs @@ -1,6 +1,6 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; using System; using System.Collections.Generic; using System.ComponentModel; @@ -11,7 +11,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormUser : Form { diff --git a/BlogDataModels/BlogViewModel/FormUsers.Designer.cs b/BlogDataModels/BlogViewModel/FormUsers.Designer.cs index c4fcc3b..0ce04cf 100644 --- a/BlogDataModels/BlogViewModel/FormUsers.Designer.cs +++ b/BlogDataModels/BlogViewModel/FormUsers.Designer.cs @@ -1,4 +1,4 @@ -namespace Forum +namespace Blog { partial class FormUsers { diff --git a/BlogDataModels/BlogViewModel/FormUsers.cs b/BlogDataModels/BlogViewModel/FormUsers.cs index c229f7c..b91df88 100644 --- a/BlogDataModels/BlogViewModel/FormUsers.cs +++ b/BlogDataModels/BlogViewModel/FormUsers.cs @@ -1,6 +1,6 @@ -using ForumBusinessLogic; -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; +using BlogBusinessLogic; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; using System; using System.Collections.Generic; using System.ComponentModel; @@ -11,7 +11,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace Forum +namespace Blog { public partial class FormUsers : Form { diff --git a/BlogDataModels/BlogViewModel/Program.cs b/BlogDataModels/BlogViewModel/Program.cs index 6c8bfaa..3e5ad9a 100644 --- a/BlogDataModels/BlogViewModel/Program.cs +++ b/BlogDataModels/BlogViewModel/Program.cs @@ -1,11 +1,11 @@ -using ForumBusinessLogic; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.StoragesContracts; +using BlogBusinessLogic; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.StoragesContracts; using BlogDatabase.Implements; using Microsoft.Extensions.DependencyInjection; using System; -namespace Forum +namespace Blog { internal static class Program { diff --git a/BlogDataModels/BusinessLogic/CategoryLogic.cs b/BlogDataModels/BusinessLogic/CategoryLogic.cs index 863933c..eb28a87 100644 --- a/BlogDataModels/BusinessLogic/CategoryLogic.cs +++ b/BlogDataModels/BusinessLogic/CategoryLogic.cs @@ -1,15 +1,15 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumBusinessLogic +namespace BlogBusinessLogic { public class CategoryLogic : ICategoryLogic { diff --git a/BlogDataModels/BusinessLogic/MessageLogic.cs b/BlogDataModels/BusinessLogic/MessageLogic.cs index b27b545..6121ef6 100644 --- a/BlogDataModels/BusinessLogic/MessageLogic.cs +++ b/BlogDataModels/BusinessLogic/MessageLogic.cs @@ -1,15 +1,15 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumBusinessLogic +namespace BlogBusinessLogic { public class MessageLogic : IMessageLogic { diff --git a/BlogDataModels/BusinessLogic/RoleLogic.cs b/BlogDataModels/BusinessLogic/RoleLogic.cs index 53c4869..616aa96 100644 --- a/BlogDataModels/BusinessLogic/RoleLogic.cs +++ b/BlogDataModels/BusinessLogic/RoleLogic.cs @@ -1,15 +1,15 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumBusinessLogic +namespace BlogBusinessLogic { public class RoleLogic : IRoleLogic { diff --git a/BlogDataModels/BusinessLogic/TopicLogic.cs b/BlogDataModels/BusinessLogic/TopicLogic.cs index 7e15a7a..850923a 100644 --- a/BlogDataModels/BusinessLogic/TopicLogic.cs +++ b/BlogDataModels/BusinessLogic/TopicLogic.cs @@ -1,15 +1,15 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumBusinessLogic +namespace BlogBusinessLogic { public class TopicLogic : ITopicLogic { diff --git a/BlogDataModels/BusinessLogic/UserLogic.cs b/BlogDataModels/BusinessLogic/UserLogic.cs index ffb0454..4f89c71 100644 --- a/BlogDataModels/BusinessLogic/UserLogic.cs +++ b/BlogDataModels/BusinessLogic/UserLogic.cs @@ -1,15 +1,15 @@ -using ForumContracts.BindingModels; -using ForumContracts.BusinessLogicContracts; -using ForumContracts.SearchModels; -using ForumContracts.StoragesContracts; -using ForumContracts.ViewModels; +using BlogContracts.BindingModels; +using BlogContracts.BusinessLogicContracts; +using BlogContracts.SearchModels; +using BlogContracts.StoragesContracts; +using BlogContracts.ViewModels; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ForumBusinessLogic +namespace BlogBusinessLogic { public class UserLogic : IUserLogic {