From 6dfa6908b109eeb901de529572704b57cd1fc879 Mon Sep 17 00:00:00 2001 From: Stanislav Mykhailenko Date: Mon, 15 May 2023 20:45:16 +0300 Subject: [PATCH] Create directories for layers --- {Service => BusinessLayer/Service}/DbService.cs | 6 +++--- {DbStartup => DataLayer/DbStartup}/DatabaseContext.cs | 6 +++--- {DbStartup => DataLayer/DbStartup}/DbInitializer.cs | 2 +- {DbStartup => DataLayer/DbStartup}/Injecting.cs | 4 ++-- {Entities => DataLayer/Entities}/BaseEntity.cs | 2 +- {Entities => DataLayer/Entities}/Board.cs | 2 +- {Entities => DataLayer/Entities}/Card.cs | 2 +- {Entities => DataLayer/Entities}/Column.cs | 2 +- {Entities => DataLayer/Entities}/Comment.cs | 2 +- {Entities => DataLayer/Entities}/User.cs | 2 +- .../EntityConfiguration}/BoardConfiguration.cs | 4 ++-- .../EntityConfiguration}/CardConfiguration.cs | 4 ++-- .../EntityConfiguration}/ColumnConfiguration.cs | 4 ++-- .../EntityConfiguration}/CommentConfiguration.cs | 4 ++-- .../EntityConfiguration}/UserConfiguration.cs | 4 ++-- {Models => DataLayer/Models}/ErrorViewModel.cs | 2 +- .../Controllers}/HomeController.cs | 8 ++++---- Program.cs | 2 +- Views/Home/Index.cshtml | 2 +- Views/_ViewImports.cshtml | 2 +- 20 files changed, 33 insertions(+), 33 deletions(-) rename {Service => BusinessLayer/Service}/DbService.cs (91%) rename {DbStartup => DataLayer/DbStartup}/DatabaseContext.cs (85%) rename {DbStartup => DataLayer/DbStartup}/DbInitializer.cs (78%) rename {DbStartup => DataLayer/DbStartup}/Injecting.cs (83%) rename {Entities => DataLayer/Entities}/BaseEntity.cs (65%) rename {Entities => DataLayer/Entities}/Board.cs (85%) rename {Entities => DataLayer/Entities}/Card.cs (89%) rename {Entities => DataLayer/Entities}/Column.cs (85%) rename {Entities => DataLayer/Entities}/Comment.cs (85%) rename {Entities => DataLayer/Entities}/User.cs (91%) rename {EntityConfiguration => DataLayer/EntityConfiguration}/BoardConfiguration.cs (82%) rename {EntityConfiguration => DataLayer/EntityConfiguration}/CardConfiguration.cs (90%) rename {EntityConfiguration => DataLayer/EntityConfiguration}/ColumnConfiguration.cs (88%) rename {EntityConfiguration => DataLayer/EntityConfiguration}/CommentConfiguration.cs (89%) rename {EntityConfiguration => DataLayer/EntityConfiguration}/UserConfiguration.cs (89%) rename {Models => DataLayer/Models}/ErrorViewModel.cs (77%) rename {Controllers => PresentationLayer/Controllers}/HomeController.cs (94%) diff --git a/Service/DbService.cs b/BusinessLayer/Service/DbService.cs similarity index 91% rename from Service/DbService.cs rename to BusinessLayer/Service/DbService.cs index 5b73cc1..fa8f233 100644 --- a/Service/DbService.cs +++ b/BusinessLayer/Service/DbService.cs @@ -1,8 +1,8 @@ -using NG_2023_Kanban.DbStartup; -using NG_2023_Kanban.Entities; +using NG_2023_Kanban.DataLayer.DbStartup; +using NG_2023_Kanban.DataLayer.Entities; using Microsoft.EntityFrameworkCore; -namespace NG_2023_Kanban.Service +namespace NG_2023_Kanban.BusinessLayer.Service { public class DbService { diff --git a/DbStartup/DatabaseContext.cs b/DataLayer/DbStartup/DatabaseContext.cs similarity index 85% rename from DbStartup/DatabaseContext.cs rename to DataLayer/DbStartup/DatabaseContext.cs index 42c14e1..2739ea7 100644 --- a/DbStartup/DatabaseContext.cs +++ b/DataLayer/DbStartup/DatabaseContext.cs @@ -1,8 +1,8 @@ -using NG_2023_Kanban.Entities; -using NG_2023_Kanban.EntityConfiguration; +using NG_2023_Kanban.DataLayer.Entities; +using NG_2023_Kanban.DataLayer.EntityConfiguration; using Microsoft.EntityFrameworkCore; -namespace NG_2023_Kanban.DbStartup +namespace NG_2023_Kanban.DataLayer.DbStartup { public class DatabaseContext : DbContext { diff --git a/DbStartup/DbInitializer.cs b/DataLayer/DbStartup/DbInitializer.cs similarity index 78% rename from DbStartup/DbInitializer.cs rename to DataLayer/DbStartup/DbInitializer.cs index e631704..9cc28e4 100644 --- a/DbStartup/DbInitializer.cs +++ b/DataLayer/DbStartup/DbInitializer.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.DbStartup +namespace NG_2023_Kanban.DataLayer.DbStartup { public class DbInitializer { diff --git a/DbStartup/Injecting.cs b/DataLayer/DbStartup/Injecting.cs similarity index 83% rename from DbStartup/Injecting.cs rename to DataLayer/DbStartup/Injecting.cs index 3cfa7b1..2fb4450 100644 --- a/DbStartup/Injecting.cs +++ b/DataLayer/DbStartup/Injecting.cs @@ -1,7 +1,7 @@ -using NG_2023_Kanban.Service; +using NG_2023_Kanban.BusinessLayer.Service; using Microsoft.EntityFrameworkCore; -namespace NG_2023_Kanban.DbStartup +namespace NG_2023_Kanban.DataLayer.DbStartup { public static class Injecting { diff --git a/Entities/BaseEntity.cs b/DataLayer/Entities/BaseEntity.cs similarity index 65% rename from Entities/BaseEntity.cs rename to DataLayer/Entities/BaseEntity.cs index a2a471a..4932a50 100644 --- a/Entities/BaseEntity.cs +++ b/DataLayer/Entities/BaseEntity.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.Entities +namespace NG_2023_Kanban.DataLayer.Entities { public abstract class BaseEntity { diff --git a/Entities/Board.cs b/DataLayer/Entities/Board.cs similarity index 85% rename from Entities/Board.cs rename to DataLayer/Entities/Board.cs index a15675c..4631ee0 100644 --- a/Entities/Board.cs +++ b/DataLayer/Entities/Board.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.Entities +namespace NG_2023_Kanban.DataLayer.Entities { public class Board : BaseEntity { diff --git a/Entities/Card.cs b/DataLayer/Entities/Card.cs similarity index 89% rename from Entities/Card.cs rename to DataLayer/Entities/Card.cs index c2422d5..04e9700 100644 --- a/Entities/Card.cs +++ b/DataLayer/Entities/Card.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.Entities +namespace NG_2023_Kanban.DataLayer.Entities { public class Card : BaseEntity { diff --git a/Entities/Column.cs b/DataLayer/Entities/Column.cs similarity index 85% rename from Entities/Column.cs rename to DataLayer/Entities/Column.cs index dfb40d8..2c58462 100644 --- a/Entities/Column.cs +++ b/DataLayer/Entities/Column.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.Entities +namespace NG_2023_Kanban.DataLayer.Entities { public class Column : BaseEntity { diff --git a/Entities/Comment.cs b/DataLayer/Entities/Comment.cs similarity index 85% rename from Entities/Comment.cs rename to DataLayer/Entities/Comment.cs index 2bf778d..1446506 100644 --- a/Entities/Comment.cs +++ b/DataLayer/Entities/Comment.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.Entities +namespace NG_2023_Kanban.DataLayer.Entities { public class Comment : BaseEntity { diff --git a/Entities/User.cs b/DataLayer/Entities/User.cs similarity index 91% rename from Entities/User.cs rename to DataLayer/Entities/User.cs index 02aea97..8bd8cf7 100644 --- a/Entities/User.cs +++ b/DataLayer/Entities/User.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.Entities +namespace NG_2023_Kanban.DataLayer.Entities { public class User : BaseEntity { diff --git a/EntityConfiguration/BoardConfiguration.cs b/DataLayer/EntityConfiguration/BoardConfiguration.cs similarity index 82% rename from EntityConfiguration/BoardConfiguration.cs rename to DataLayer/EntityConfiguration/BoardConfiguration.cs index 684b1ee..e87de2e 100644 --- a/EntityConfiguration/BoardConfiguration.cs +++ b/DataLayer/EntityConfiguration/BoardConfiguration.cs @@ -1,8 +1,8 @@ -using NG_2023_Kanban.Entities; +using NG_2023_Kanban.DataLayer.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace NG_2023_Kanban.EntityConfiguration +namespace NG_2023_Kanban.DataLayer.EntityConfiguration { public class BoardConfiguration : IEntityTypeConfiguration { diff --git a/EntityConfiguration/CardConfiguration.cs b/DataLayer/EntityConfiguration/CardConfiguration.cs similarity index 90% rename from EntityConfiguration/CardConfiguration.cs rename to DataLayer/EntityConfiguration/CardConfiguration.cs index c89a0b4..a589570 100644 --- a/EntityConfiguration/CardConfiguration.cs +++ b/DataLayer/EntityConfiguration/CardConfiguration.cs @@ -1,8 +1,8 @@ -using NG_2023_Kanban.Entities; +using NG_2023_Kanban.DataLayer.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace NG_2023_Kanban.EntityConfiguration +namespace NG_2023_Kanban.DataLayer.EntityConfiguration { public class CardConfiguration : IEntityTypeConfiguration { diff --git a/EntityConfiguration/ColumnConfiguration.cs b/DataLayer/EntityConfiguration/ColumnConfiguration.cs similarity index 88% rename from EntityConfiguration/ColumnConfiguration.cs rename to DataLayer/EntityConfiguration/ColumnConfiguration.cs index 9f7175b..a964ce6 100644 --- a/EntityConfiguration/ColumnConfiguration.cs +++ b/DataLayer/EntityConfiguration/ColumnConfiguration.cs @@ -1,8 +1,8 @@ -using NG_2023_Kanban.Entities; +using NG_2023_Kanban.DataLayer.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace NG_2023_Kanban.EntityConfiguration +namespace NG_2023_Kanban.DataLayer.EntityConfiguration { public class ColumnConfiguration : IEntityTypeConfiguration { diff --git a/EntityConfiguration/CommentConfiguration.cs b/DataLayer/EntityConfiguration/CommentConfiguration.cs similarity index 89% rename from EntityConfiguration/CommentConfiguration.cs rename to DataLayer/EntityConfiguration/CommentConfiguration.cs index 90c8709..d0bf996 100644 --- a/EntityConfiguration/CommentConfiguration.cs +++ b/DataLayer/EntityConfiguration/CommentConfiguration.cs @@ -1,8 +1,8 @@ -using NG_2023_Kanban.Entities; +using NG_2023_Kanban.DataLayer.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace NG_2023_Kanban.EntityConfiguration +namespace NG_2023_Kanban.DataLayer.EntityConfiguration { public class CommentConfiguration : IEntityTypeConfiguration { diff --git a/EntityConfiguration/UserConfiguration.cs b/DataLayer/EntityConfiguration/UserConfiguration.cs similarity index 89% rename from EntityConfiguration/UserConfiguration.cs rename to DataLayer/EntityConfiguration/UserConfiguration.cs index ab1ccf3..d55a8c3 100644 --- a/EntityConfiguration/UserConfiguration.cs +++ b/DataLayer/EntityConfiguration/UserConfiguration.cs @@ -1,8 +1,8 @@ -using NG_2023_Kanban.Entities; +using NG_2023_Kanban.DataLayer.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace NG_2023_Kanban.EntityConfiguration +namespace NG_2023_Kanban.DataLayer.EntityConfiguration { public class UserConfiguration : IEntityTypeConfiguration { diff --git a/Models/ErrorViewModel.cs b/DataLayer/Models/ErrorViewModel.cs similarity index 77% rename from Models/ErrorViewModel.cs rename to DataLayer/Models/ErrorViewModel.cs index eb8ed3a..ab5c981 100644 --- a/Models/ErrorViewModel.cs +++ b/DataLayer/Models/ErrorViewModel.cs @@ -1,4 +1,4 @@ -namespace NG_2023_Kanban.Models; +namespace NG_2023_Kanban.DataLayer.Models; public class ErrorViewModel { diff --git a/Controllers/HomeController.cs b/PresentationLayer/Controllers/HomeController.cs similarity index 94% rename from Controllers/HomeController.cs rename to PresentationLayer/Controllers/HomeController.cs index 43a2a82..74a6845 100644 --- a/Controllers/HomeController.cs +++ b/PresentationLayer/Controllers/HomeController.cs @@ -1,11 +1,11 @@ using System.Diagnostics; using Microsoft.AspNetCore.Mvc; -using NG_2023_Kanban.Entities; +using NG_2023_Kanban.DataLayer.Entities; using NG_2023_Kanban.Extensions; -using NG_2023_Kanban.Models; -using NG_2023_Kanban.Service; +using NG_2023_Kanban.DataLayer.Models; +using NG_2023_Kanban.BusinessLayer.Service; -namespace NG_2023_Kanban.Controllers; +namespace NG_2023_Kanban.PresentationLayer.Controllers; public class HomeController : Controller { diff --git a/Program.cs b/Program.cs index 1fba521..5fba0f6 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,4 @@ -using NG_2023_Kanban.DbStartup; +using NG_2023_Kanban.DataLayer.DbStartup; var builder = WebApplication.CreateBuilder(args); diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 479f082..76a8290 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -1,4 +1,4 @@ -@using NG_2023_Kanban.Entities +@using NG_2023_Kanban.DataLayer.Entities @{ var user = ViewData["Account"] as User; } diff --git a/Views/_ViewImports.cshtml b/Views/_ViewImports.cshtml index 9439c11..0a03a7d 100644 --- a/Views/_ViewImports.cshtml +++ b/Views/_ViewImports.cshtml @@ -1,3 +1,3 @@ @using NG_2023_Kanban -@using NG_2023_Kanban.Models +@using NG_2023_Kanban.DataLayer.Models @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers