From ecdd8c8f5618623ef99dc892f649accf5d77fa48 Mon Sep 17 00:00:00 2001 From: clchieu Date: Tue, 27 Feb 2024 21:14:57 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9placement=20des=20dto=20et=20suppression?= =?UTF-8?q?=20d'une=20couche=20de=20hi=C3=A9rarchie=20inutile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Controllers/InquiriesController.cs | 17 +++++++------ API_SQLuedo/API/Controllers/UserController.cs | 14 +++++------ API_SQLuedo/API_SQLuedo.sln | 6 +++++ .../{Model/DTO => Dto}/BlackListDTO.cs | 8 +------ .../{Model/DTO => Dto}/ContentLessonDTO.cs | 10 +------- API_SQLuedo/Dto/Dto.csproj | 9 +++++++ API_SQLuedo/{Model/DTO => Dto}/InquiryDTO.cs | 9 +------ .../{Model/DTO => Dto}/InquiryTableDTO.cs | 9 +------ API_SQLuedo/{Model/DTO => Dto}/LessonDTO.cs | 8 +------ API_SQLuedo/{Model/DTO => Dto}/NotepadDTO.cs | 8 +------ .../{Model/DTO => Dto}/ParagraphDTO.cs | 8 +------ API_SQLuedo/{Model/DTO => Dto}/SolutionDTO.cs | 9 +------ API_SQLuedo/{Model/DTO => Dto}/SuccessDTO.cs | 8 +------ API_SQLuedo/{Model/DTO => Dto}/UserDTO.cs | 8 +------ .../{SQLuedoDB => }/BlackListEntity.cs | 0 .../{SQLuedoDB => }/ContentLessonEntity.cs | 0 .../{SQLuedoDB => }/InquiryEntity.cs | 0 .../{SQLuedoDB => }/InquiryTableEntity.cs | 0 .../{SQLuedoDB => }/LessonEntity.cs | 0 .../{SQLuedoDB => }/NotepadEntity.cs | 0 .../{SQLuedoDB => }/ParagraphEntity.cs | 0 .../{SQLuedoDB => }/SolutionEntity.cs | 0 .../{SQLuedoDB => }/SuccessEntity.cs | 0 .../{SQLuedoDB => }/UserEntity.cs | 0 API_SQLuedo/Model/Mappers/BlackListMapper.cs | 2 +- .../Model/Mappers/ContentLessonMapper.cs | 1 + API_SQLuedo/Model/Mappers/InquiryMapper.cs | 2 +- .../Model/Mappers/InquiryTableMapper.cs | 2 +- API_SQLuedo/Model/Mappers/LessonMapper.cs | 2 +- API_SQLuedo/Model/Mappers/NotepadMapper.cs | 2 +- API_SQLuedo/Model/Mappers/ParagraphMapper.cs | 3 ++- API_SQLuedo/Model/Mappers/SolutionMapper.cs | 2 +- API_SQLuedo/Model/Mappers/SuccessMapper.cs | 2 +- API_SQLuedo/Model/Mappers/UserMapper.cs | 4 ++-- API_SQLuedo/Model/Model.csproj | 1 + API_SQLuedo/Services/IDataService.cs | 4 ++-- API_SQLuedo/Services/UserDataService.cs | 24 +++++++++---------- API_SQLuedo/TestConsoleAPI/Program.cs | 2 +- 38 files changed, 68 insertions(+), 116 deletions(-) rename API_SQLuedo/{Model/DTO => Dto}/BlackListDTO.cs (68%) rename API_SQLuedo/{Model/DTO => Dto}/ContentLessonDTO.cs (56%) create mode 100644 API_SQLuedo/Dto/Dto.csproj rename API_SQLuedo/{Model/DTO => Dto}/InquiryDTO.cs (78%) rename API_SQLuedo/{Model/DTO => Dto}/InquiryTableDTO.cs (73%) rename API_SQLuedo/{Model/DTO => Dto}/LessonDTO.cs (83%) rename API_SQLuedo/{Model/DTO => Dto}/NotepadDTO.cs (81%) rename API_SQLuedo/{Model/DTO => Dto}/ParagraphDTO.cs (86%) rename API_SQLuedo/{Model/DTO => Dto}/SolutionDTO.cs (87%) rename API_SQLuedo/{Model/DTO => Dto}/SuccessDTO.cs (73%) rename API_SQLuedo/{Model/DTO => Dto}/UserDTO.cs (86%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/BlackListEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/ContentLessonEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/InquiryEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/InquiryTableEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/LessonEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/NotepadEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/ParagraphEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/SolutionEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/SuccessEntity.cs (100%) rename API_SQLuedo/EntityFramework/{SQLuedoDB => }/UserEntity.cs (100%) diff --git a/API_SQLuedo/API/Controllers/InquiriesController.cs b/API_SQLuedo/API/Controllers/InquiriesController.cs index e42d14e..c1d8210 100644 --- a/API_SQLuedo/API/Controllers/InquiriesController.cs +++ b/API_SQLuedo/API/Controllers/InquiriesController.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Model.DTO; using Services; namespace API.Controllers @@ -21,9 +20,9 @@ namespace API.Controllers [HttpGet("inquiries/{page}/{number}")] public IActionResult GetInquiries(int page, int number) - { + { var nbInquiry = _inquiryDataService.GetInquiries(page, number).Count(); - if (nbInquiry == 0) + if (nbInquiry == 0) { _logger.LogError("[ERREUR] Aucune enquête trouvé."); return StatusCode(204); @@ -34,13 +33,13 @@ namespace API.Controllers [HttpGet("inquiry/id/{id}")] public IActionResult GetInquiryById(int id) - { + { try { _logger.LogInformation("[INFORMATION] Enquête avec l'id {id} a été trouvé.", id); return Ok(_inquiryDataService.GetInquiryById(id)); - } - catch (ArgumentException) + } + catch (ArgumentException) { _logger.LogError("[ERREUR] Aucune enquête trouvée avec l'id {id}.", id); return NotFound(); @@ -49,13 +48,13 @@ namespace API.Controllers [HttpGet("inquiry/title/{title}")] public IActionResult GetInquiryByTitle(string title) - { + { try { _logger.LogInformation("[INFORMATION] Enquête avec le titre {title} a été trouvé.", title); return Ok(_inquiryDataService.GetInquiryByTitle(title)); - } - catch (ArgumentException) + } + catch (ArgumentException) { _logger.LogError("[ERREUR] Aucune enquête trouvée avec le titre {title}.", title); return NotFound(); diff --git a/API_SQLuedo/API/Controllers/UserController.cs b/API_SQLuedo/API/Controllers/UserController.cs index 6d2e9d6..2eb4be4 100644 --- a/API_SQLuedo/API/Controllers/UserController.cs +++ b/API_SQLuedo/API/Controllers/UserController.cs @@ -1,9 +1,9 @@ using DbContextLib; +using Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Model.Business; -using Model.DTO; using Services; namespace API.Controllers @@ -14,8 +14,8 @@ namespace API.Controllers [ApiController] public class UserController : Controller { - private IDataService _userDataService; - + private IDataService _userDataService; + private readonly ILogger _logger; public UserController(IDataService userDataService, ILogger logger) @@ -85,9 +85,9 @@ namespace API.Controllers [HttpPost] public IActionResult CreateUser([FromBody]UserDTO dto) { - if (dto.Username == null || dto.Password == null || dto.Email == null) - { - return BadRequest(); + if (dto.Username == null || dto.Password == null || dto.Email == null) + { + return BadRequest(); } // return Ok(_userDataService.CreateUser(username, password, email, isAdmin)); _logger.LogInformation("[INFORMATION] Un utilisateur a été créé : username - {username}, password - {password}, email - {email}, isAdmin - {isAdmin}", dto.Username, dto.Password, dto.Email, dto.IsAdmin); @@ -98,7 +98,7 @@ namespace API.Controllers public IActionResult UpdateUser(int id, [FromBody] UserDTO userDTO) { if(id != userDTO.Id) - { + { _logger.LogError("[ERREUR] Problème ID - La mise à jour de l'utilisateur avec l'id {id} a échouée.", id); return BadRequest(); } diff --git a/API_SQLuedo/API_SQLuedo.sln b/API_SQLuedo/API_SQLuedo.sln index fbefbe6..a02afdd 100644 --- a/API_SQLuedo/API_SQLuedo.sln +++ b/API_SQLuedo/API_SQLuedo.sln @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestConsoleAPI", "TestConso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StubbedContextLib", "StubbedContextLib\StubbedContextLib.csproj", "{B64941C9-0550-4C47-89B6-396F6DB0486D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dto", "Dto\Dto.csproj", "{9682CA6B-2380-463B-B6BC-17C3B9E992C8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -63,6 +65,10 @@ Global {B64941C9-0550-4C47-89B6-396F6DB0486D}.Debug|Any CPU.Build.0 = Debug|Any CPU {B64941C9-0550-4C47-89B6-396F6DB0486D}.Release|Any CPU.ActiveCfg = Release|Any CPU {B64941C9-0550-4C47-89B6-396F6DB0486D}.Release|Any CPU.Build.0 = Release|Any CPU + {9682CA6B-2380-463B-B6BC-17C3B9E992C8}.Debug|Any CPU.ActiveCfg = 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.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/API_SQLuedo/Model/DTO/BlackListDTO.cs b/API_SQLuedo/Dto/BlackListDTO.cs similarity index 68% rename from API_SQLuedo/Model/DTO/BlackListDTO.cs rename to API_SQLuedo/Dto/BlackListDTO.cs index 2ecfcaf..e614e70 100644 --- a/API_SQLuedo/Model/DTO/BlackListDTO.cs +++ b/API_SQLuedo/Dto/BlackListDTO.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class BlackListDTO { diff --git a/API_SQLuedo/Model/DTO/ContentLessonDTO.cs b/API_SQLuedo/Dto/ContentLessonDTO.cs similarity index 56% rename from API_SQLuedo/Model/DTO/ContentLessonDTO.cs rename to API_SQLuedo/Dto/ContentLessonDTO.cs index 966509c..ef844e7 100644 --- a/API_SQLuedo/Model/DTO/ContentLessonDTO.cs +++ b/API_SQLuedo/Dto/ContentLessonDTO.cs @@ -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 Dto { public class ContentLessonDTO { diff --git a/API_SQLuedo/Dto/Dto.csproj b/API_SQLuedo/Dto/Dto.csproj new file mode 100644 index 0000000..3a63532 --- /dev/null +++ b/API_SQLuedo/Dto/Dto.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/API_SQLuedo/Model/DTO/InquiryDTO.cs b/API_SQLuedo/Dto/InquiryDTO.cs similarity index 78% rename from API_SQLuedo/Model/DTO/InquiryDTO.cs rename to API_SQLuedo/Dto/InquiryDTO.cs index 8060ef3..a1e438f 100644 --- a/API_SQLuedo/Model/DTO/InquiryDTO.cs +++ b/API_SQLuedo/Dto/InquiryDTO.cs @@ -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.DTO +namespace Dto { public class InquiryDTO { diff --git a/API_SQLuedo/Model/DTO/InquiryTableDTO.cs b/API_SQLuedo/Dto/InquiryTableDTO.cs similarity index 73% rename from API_SQLuedo/Model/DTO/InquiryTableDTO.cs rename to API_SQLuedo/Dto/InquiryTableDTO.cs index e08ecda..ce28216 100644 --- a/API_SQLuedo/Model/DTO/InquiryTableDTO.cs +++ b/API_SQLuedo/Dto/InquiryTableDTO.cs @@ -1,11 +1,4 @@ -using Model.Business; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class InquiryTableDTO { diff --git a/API_SQLuedo/Model/DTO/LessonDTO.cs b/API_SQLuedo/Dto/LessonDTO.cs similarity index 83% rename from API_SQLuedo/Model/DTO/LessonDTO.cs rename to API_SQLuedo/Dto/LessonDTO.cs index 8680d98..70983ff 100644 --- a/API_SQLuedo/Model/DTO/LessonDTO.cs +++ b/API_SQLuedo/Dto/LessonDTO.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class LessonDTO { diff --git a/API_SQLuedo/Model/DTO/NotepadDTO.cs b/API_SQLuedo/Dto/NotepadDTO.cs similarity index 81% rename from API_SQLuedo/Model/DTO/NotepadDTO.cs rename to API_SQLuedo/Dto/NotepadDTO.cs index e3fd9c9..3e86998 100644 --- a/API_SQLuedo/Model/DTO/NotepadDTO.cs +++ b/API_SQLuedo/Dto/NotepadDTO.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class NotepadDTO { diff --git a/API_SQLuedo/Model/DTO/ParagraphDTO.cs b/API_SQLuedo/Dto/ParagraphDTO.cs similarity index 86% rename from API_SQLuedo/Model/DTO/ParagraphDTO.cs rename to API_SQLuedo/Dto/ParagraphDTO.cs index e6a3442..c203c9c 100644 --- a/API_SQLuedo/Model/DTO/ParagraphDTO.cs +++ b/API_SQLuedo/Dto/ParagraphDTO.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class ParagraphDTO { diff --git a/API_SQLuedo/Model/DTO/SolutionDTO.cs b/API_SQLuedo/Dto/SolutionDTO.cs similarity index 87% rename from API_SQLuedo/Model/DTO/SolutionDTO.cs rename to API_SQLuedo/Dto/SolutionDTO.cs index 50e1e84..a775fd6 100644 --- a/API_SQLuedo/Model/DTO/SolutionDTO.cs +++ b/API_SQLuedo/Dto/SolutionDTO.cs @@ -1,11 +1,4 @@ -using Model.Business; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class SolutionDTO { diff --git a/API_SQLuedo/Model/DTO/SuccessDTO.cs b/API_SQLuedo/Dto/SuccessDTO.cs similarity index 73% rename from API_SQLuedo/Model/DTO/SuccessDTO.cs rename to API_SQLuedo/Dto/SuccessDTO.cs index 924117a..ad3fcb3 100644 --- a/API_SQLuedo/Model/DTO/SuccessDTO.cs +++ b/API_SQLuedo/Dto/SuccessDTO.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class SuccessDTO { diff --git a/API_SQLuedo/Model/DTO/UserDTO.cs b/API_SQLuedo/Dto/UserDTO.cs similarity index 86% rename from API_SQLuedo/Model/DTO/UserDTO.cs rename to API_SQLuedo/Dto/UserDTO.cs index 06aa236..9a96905 100644 --- a/API_SQLuedo/Model/DTO/UserDTO.cs +++ b/API_SQLuedo/Dto/UserDTO.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model.DTO +namespace Dto { public class UserDTO { diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/BlackListEntity.cs b/API_SQLuedo/EntityFramework/BlackListEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/BlackListEntity.cs rename to API_SQLuedo/EntityFramework/BlackListEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/ContentLessonEntity.cs b/API_SQLuedo/EntityFramework/ContentLessonEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/ContentLessonEntity.cs rename to API_SQLuedo/EntityFramework/ContentLessonEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/InquiryEntity.cs b/API_SQLuedo/EntityFramework/InquiryEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/InquiryEntity.cs rename to API_SQLuedo/EntityFramework/InquiryEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/InquiryTableEntity.cs b/API_SQLuedo/EntityFramework/InquiryTableEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/InquiryTableEntity.cs rename to API_SQLuedo/EntityFramework/InquiryTableEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/LessonEntity.cs b/API_SQLuedo/EntityFramework/LessonEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/LessonEntity.cs rename to API_SQLuedo/EntityFramework/LessonEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/NotepadEntity.cs b/API_SQLuedo/EntityFramework/NotepadEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/NotepadEntity.cs rename to API_SQLuedo/EntityFramework/NotepadEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/ParagraphEntity.cs b/API_SQLuedo/EntityFramework/ParagraphEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/ParagraphEntity.cs rename to API_SQLuedo/EntityFramework/ParagraphEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/SolutionEntity.cs b/API_SQLuedo/EntityFramework/SolutionEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/SolutionEntity.cs rename to API_SQLuedo/EntityFramework/SolutionEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/SuccessEntity.cs b/API_SQLuedo/EntityFramework/SuccessEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/SuccessEntity.cs rename to API_SQLuedo/EntityFramework/SuccessEntity.cs diff --git a/API_SQLuedo/EntityFramework/SQLuedoDB/UserEntity.cs b/API_SQLuedo/EntityFramework/UserEntity.cs similarity index 100% rename from API_SQLuedo/EntityFramework/SQLuedoDB/UserEntity.cs rename to API_SQLuedo/EntityFramework/UserEntity.cs diff --git a/API_SQLuedo/Model/Mappers/BlackListMapper.cs b/API_SQLuedo/Model/Mappers/BlackListMapper.cs index 8f6f52d..4ada8c5 100644 --- a/API_SQLuedo/Model/Mappers/BlackListMapper.cs +++ b/API_SQLuedo/Model/Mappers/BlackListMapper.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; namespace Model.Mappers { diff --git a/API_SQLuedo/Model/Mappers/ContentLessonMapper.cs b/API_SQLuedo/Model/Mappers/ContentLessonMapper.cs index f568070..4084b0b 100644 --- a/API_SQLuedo/Model/Mappers/ContentLessonMapper.cs +++ b/API_SQLuedo/Model/Mappers/ContentLessonMapper.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; diff --git a/API_SQLuedo/Model/Mappers/InquiryMapper.cs b/API_SQLuedo/Model/Mappers/InquiryMapper.cs index a26ef45..e6d30d4 100644 --- a/API_SQLuedo/Model/Mappers/InquiryMapper.cs +++ b/API_SQLuedo/Model/Mappers/InquiryMapper.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; namespace Model.Mappers { diff --git a/API_SQLuedo/Model/Mappers/InquiryTableMapper.cs b/API_SQLuedo/Model/Mappers/InquiryTableMapper.cs index 234aa35..b1c9d55 100644 --- a/API_SQLuedo/Model/Mappers/InquiryTableMapper.cs +++ b/API_SQLuedo/Model/Mappers/InquiryTableMapper.cs @@ -1,10 +1,10 @@ using Model.Business; -using Model.DTO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; namespace Model.Mappers diff --git a/API_SQLuedo/Model/Mappers/LessonMapper.cs b/API_SQLuedo/Model/Mappers/LessonMapper.cs index 1ca4094..f33dd25 100644 --- a/API_SQLuedo/Model/Mappers/LessonMapper.cs +++ b/API_SQLuedo/Model/Mappers/LessonMapper.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; namespace Model.Mappers { diff --git a/API_SQLuedo/Model/Mappers/NotepadMapper.cs b/API_SQLuedo/Model/Mappers/NotepadMapper.cs index f19109b..2984220 100644 --- a/API_SQLuedo/Model/Mappers/NotepadMapper.cs +++ b/API_SQLuedo/Model/Mappers/NotepadMapper.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; namespace Model.Mappers { diff --git a/API_SQLuedo/Model/Mappers/ParagraphMapper.cs b/API_SQLuedo/Model/Mappers/ParagraphMapper.cs index 5d1928c..0ce3d02 100644 --- a/API_SQLuedo/Model/Mappers/ParagraphMapper.cs +++ b/API_SQLuedo/Model/Mappers/ParagraphMapper.cs @@ -3,9 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; + namespace Model.Mappers { public static class ParagraphMapper diff --git a/API_SQLuedo/Model/Mappers/SolutionMapper.cs b/API_SQLuedo/Model/Mappers/SolutionMapper.cs index a464be8..6afd56b 100644 --- a/API_SQLuedo/Model/Mappers/SolutionMapper.cs +++ b/API_SQLuedo/Model/Mappers/SolutionMapper.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; namespace Model.Mappers { diff --git a/API_SQLuedo/Model/Mappers/SuccessMapper.cs b/API_SQLuedo/Model/Mappers/SuccessMapper.cs index 04f56b3..9db8e9f 100644 --- a/API_SQLuedo/Model/Mappers/SuccessMapper.cs +++ b/API_SQLuedo/Model/Mappers/SuccessMapper.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Dto; using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; namespace Model.Mappers { diff --git a/API_SQLuedo/Model/Mappers/UserMapper.cs b/API_SQLuedo/Model/Mappers/UserMapper.cs index 68d80a0..ab2dda5 100644 --- a/API_SQLuedo/Model/Mappers/UserMapper.cs +++ b/API_SQLuedo/Model/Mappers/UserMapper.cs @@ -1,6 +1,6 @@ -using Entities.SQLuedoDB; +using Dto; +using Entities.SQLuedoDB; using Model.Business; -using Model.DTO; namespace Model.Mappers { diff --git a/API_SQLuedo/Model/Model.csproj b/API_SQLuedo/Model/Model.csproj index 6e81eea..73abdcf 100644 --- a/API_SQLuedo/Model/Model.csproj +++ b/API_SQLuedo/Model/Model.csproj @@ -20,6 +20,7 @@ + diff --git a/API_SQLuedo/Services/IDataService.cs b/API_SQLuedo/Services/IDataService.cs index a3faad9..1f81b09 100644 --- a/API_SQLuedo/Services/IDataService.cs +++ b/API_SQLuedo/Services/IDataService.cs @@ -1,5 +1,5 @@ -using Model.Business; -using Model.DTO; +using Dto; +using Model.Business; namespace Services { diff --git a/API_SQLuedo/Services/UserDataService.cs b/API_SQLuedo/Services/UserDataService.cs index ddaa3e6..1a8fdff 100644 --- a/API_SQLuedo/Services/UserDataService.cs +++ b/API_SQLuedo/Services/UserDataService.cs @@ -1,10 +1,10 @@ using DbContextLib; -using Model.DTO; 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; @@ -92,16 +92,16 @@ namespace Services public IEnumerable GetInquiries(int page, int number) { throw new NotImplementedException(); - } - - public InquiryDTO GetInquiryById(int id) - { - throw new NotImplementedException(); - } - - public InquiryDTO GetInquiryByTitle(string title) - { - throw new NotImplementedException(); - } + } + + public InquiryDTO GetInquiryById(int id) + { + throw new NotImplementedException(); + } + + public InquiryDTO GetInquiryByTitle(string title) + { + throw new NotImplementedException(); + } } } diff --git a/API_SQLuedo/TestConsoleAPI/Program.cs b/API_SQLuedo/TestConsoleAPI/Program.cs index 651de21..9d83c32 100644 --- a/API_SQLuedo/TestConsoleAPI/Program.cs +++ b/API_SQLuedo/TestConsoleAPI/Program.cs @@ -2,12 +2,12 @@ using API.Controllers; using DbContextLib; +using Dto; using Microsoft.AspNetCore.Mvc; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Model.DTO; using Services; var connection = new SqliteConnection("DataSource=:memory:");