🏗️Séparation des dto, model et mapper

pull/29/head
Clement CHIEU 1 year ago
parent ecdd8c8f56
commit 5c133445a5

@ -1,9 +1,6 @@
using DbContextLib; using Dto;
using Dto;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Model.Business;
using Services; using Services;
namespace API.Controllers namespace API.Controllers

@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "API", "API\API.csproj", "{6
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Entities", "EntityFramework\Entities.csproj", "{6D079CDA-C000-4833-98A0-D07D153EA264}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Entities", "EntityFramework\Entities.csproj", "{6D079CDA-C000-4833-98A0-D07D153EA264}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{ADCC427D-A3CD-431C-A90B-F9369C4584E8}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModelToEntities", "ModelToEntities\ModelToEntities.csproj", "{ADCC427D-A3CD-431C-A90B-F9369C4584E8}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAPI", "TestAPI\TestAPI.csproj", "{17025B90-8B2A-49E9-97D3-1A84A208DF50}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAPI", "TestAPI\TestAPI.csproj", "{17025B90-8B2A-49E9-97D3-1A84A208DF50}"
EndProject EndProject
@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StubbedContextLib", "Stubbe
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dto", "Dto\Dto.csproj", "{9682CA6B-2380-463B-B6BC-17C3B9E992C8}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dto", "Dto\Dto.csproj", "{9682CA6B-2380-463B-B6BC-17C3B9E992C8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{EDDA59D4-BD38-46BF-8292-26A47187B76F}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -69,6 +71,10 @@ Global
{9682CA6B-2380-463B-B6BC-17C3B9E992C8}.Debug|Any CPU.Build.0 = Debug|Any CPU {9682CA6B-2380-463B-B6BC-17C3B9E992C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9682CA6B-2380-463B-B6BC-17C3B9E992C8}.Release|Any CPU.ActiveCfg = Release|Any CPU {9682CA6B-2380-463B-B6BC-17C3B9E992C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9682CA6B-2380-463B-B6BC-17C3B9E992C8}.Release|Any CPU.Build.0 = Release|Any CPU {9682CA6B-2380-463B-B6BC-17C3B9E992C8}.Release|Any CPU.Build.0 = Release|Any CPU
{EDDA59D4-BD38-46BF-8292-26A47187B76F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDDA59D4-BD38-46BF-8292-26A47187B76F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDDA59D4-BD38-46BF-8292-26A47187B76F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDDA59D4-BD38-46BF-8292-26A47187B76F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -1,4 +1,4 @@
using Entities.SQLuedoDB; using Entities;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Entities.SQLuedoDB namespace Entities
{ {
public class BlackListEntity public class BlackListEntity
{ {

@ -1,13 +1,6 @@
using System; using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Entities.SQLuedoDB;
namespace Entities.SQLuedoDB namespace Entities
{ {
public class ContentLessonEntity public class ContentLessonEntity
{ {

@ -1,10 +1,4 @@
using System; namespace Entities
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.SQLuedoDB
{ {
public class InquiryEntity public class InquiryEntity
{ {

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema;
namespace Entities.SQLuedoDB namespace Entities
{ {
public class InquiryTableEntity public class InquiryTableEntity
{ {

@ -1,10 +1,4 @@
using System; namespace Entities
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.SQLuedoDB
{ {
public class LessonEntity public class LessonEntity
{ {

@ -1,11 +1,6 @@
using System; using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.SQLuedoDB namespace Entities
{ {
public class NotepadEntity public class NotepadEntity
{ {

@ -1,4 +1,4 @@
namespace Entities.SQLuedoDB namespace Entities
{ {
public class ParagraphEntity public class ParagraphEntity
{ {

@ -1,8 +1,7 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema;
using System.Security.Cryptography.X509Certificates;
namespace Entities.SQLuedoDB namespace Entities
{ {
public class SolutionEntity public class SolutionEntity
{ {

@ -1,12 +1,6 @@
using System; using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.SQLuedoDB namespace Entities
{ {
public class SuccessEntity public class SuccessEntity
{ {

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Entities.SQLuedoDB namespace Entities
{ {
[Table("user")] [Table("user")]
public class UserEntity public class UserEntity

@ -1,10 +1,4 @@
using System; namespace ModelToEntities.Business
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class BlackList public class BlackList
{ {

@ -1,12 +1,4 @@
using Entities.SQLuedoDB; namespace ModelToEntities.Business
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class ContentLesson public class ContentLesson
{ {

@ -1,12 +1,4 @@
using Entities.SQLuedoDB; namespace ModelToEntities.Business
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class Inquiry public class Inquiry
{ {

@ -1,11 +1,4 @@
using Entities.SQLuedoDB; namespace ModelToEntities.Business
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class InquiryTable public class InquiryTable
{ {

@ -1,10 +1,4 @@
using System; namespace ModelToEntities.Business
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class Lesson public class Lesson
{ {

@ -6,22 +6,4 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dto\Dto.csproj" />
<ProjectReference Include="..\EntityFramework\Entities.csproj" />
</ItemGroup>
</Project> </Project>

@ -1,12 +1,4 @@
using Entities.SQLuedoDB; namespace ModelToEntities.Business
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class Notepad public class Notepad
{ {

@ -1,10 +1,4 @@
using System; namespace ModelToEntities.Business
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class Paragraph public class Paragraph
{ {

@ -1,11 +1,4 @@
using Entities.SQLuedoDB; namespace ModelToEntities.Business
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class Solution public class Solution
{ {

@ -1,12 +1,4 @@
using Entities.SQLuedoDB; namespace ModelToEntities.Business
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Business
{ {
public class Success public class Success
{ {

@ -1,4 +1,4 @@
namespace Model.Business namespace ModelToEntities.Business
{ {
public class User public class User
{ {

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class BlackListMapper public static class BlackListMapper
{ {

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class ContentLessonMapper public static class ContentLessonMapper
{ {

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class InquiryMapper public static class InquiryMapper
{ {

@ -1,13 +1,8 @@
using Model.Business; using Dto;
using System; using Entities;
using System.Collections.Generic; using ModelToEntities.Business;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class InquiryTableMapper public static class InquiryTableMapper
{ {

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks; namespace ModelToEntities
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers
{ {
public static class LessonMapper public static class LessonMapper
{ {

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>ModelToEntities</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dto\Dto.csproj" />
<ProjectReference Include="..\EntityFramework\Entities.csproj" />
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>
</Project>

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class NotepadMapper public static class NotepadMapper
{ {

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class ParagraphMapper public static class ParagraphMapper
{ {

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class SolutionMapper public static class SolutionMapper
{ {

@ -1,13 +1,8 @@
using System; using Dto;
using System.Collections.Generic; using Entities;
using System.Linq; using ModelToEntities.Business;
using System.Text;
using System.Threading.Tasks;
using Dto;
using Entities.SQLuedoDB;
using Model.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class SuccessMapper public static class SuccessMapper
{ {

@ -1,8 +1,8 @@
using Dto; using Dto;
using Entities.SQLuedoDB; using Entities;
using Model.Business; using ModelToEntities.Business;
namespace Model.Mappers namespace ModelToEntities
{ {
public static class UserMapper public static class UserMapper
{ {

@ -1,5 +1,5 @@
using Dto; using Dto;
using Model.Business; using ModelToEntities.Business;
namespace Services namespace Services
{ {

@ -22,7 +22,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DbContextLib\DbContextLib.csproj" /> <ProjectReference Include="..\DbContextLib\DbContextLib.csproj" />
<ProjectReference Include="..\EntityFramework\Entities.csproj" /> <ProjectReference Include="..\EntityFramework\Entities.csproj" />
<ProjectReference Include="..\Model\Model.csproj" /> <ProjectReference Include="..\ModelToEntities\ModelToEntities.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,13 +1,7 @@
using DbContextLib; using DbContextLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dto; using Dto;
using Model.Mappers;
using Model.Business;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ModelToEntities;
namespace Services namespace Services
{ {

@ -1,6 +1,6 @@
using System.Security.Cryptography; using System.Security.Cryptography;
using DbContextLib; using DbContextLib;
using Entities.SQLuedoDB; using Entities;
using Microsoft.AspNetCore.Cryptography.KeyDerivation; using Microsoft.AspNetCore.Cryptography.KeyDerivation;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;

@ -14,7 +14,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\API\API.csproj" /> <ProjectReference Include="..\API\API.csproj" />
<ProjectReference Include="..\DbContextLib\DbContextLib.csproj" /> <ProjectReference Include="..\DbContextLib\DbContextLib.csproj" />
<ProjectReference Include="..\Model\Model.csproj" /> <ProjectReference Include="..\ModelToEntities\ModelToEntities.csproj" />
<ProjectReference Include="..\Services\Services.csproj" /> <ProjectReference Include="..\Services\Services.csproj" />
</ItemGroup> </ItemGroup>

Loading…
Cancel
Save