🏗️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.Http;
using Microsoft.AspNetCore.Mvc;
using Model.Business;
using Services;
namespace API.Controllers

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

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

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

@ -1,13 +1,6 @@
using System;
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;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entities.SQLuedoDB
namespace Entities
{
public class ContentLessonEntity
{

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.SQLuedoDB
namespace Entities
{
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
{

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

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

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

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

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

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

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

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

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

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

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

@ -1,27 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</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>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save