From 1d22432e0c348435aaeb9a4fa11d7fb8e5289d39 Mon Sep 17 00:00:00 2001 From: Nestisse Date: Sat, 16 Mar 2024 09:10:55 +0100 Subject: [PATCH] =?UTF-8?q?code=20smells=20supprim=C3=A9=20car=20non=20res?= =?UTF-8?q?pect=20des=20conventions=20de=20nommage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Controllers/InquiriesController.cs | 20 +++--- .../API/Controllers/LessonsController.cs | 20 +++--- .../API/Controllers/ParagraphsController.cs | 20 +++--- .../API/Controllers/SuccessesController.cs | 20 +++--- API_SQLuedo/API/Controllers/UserController.cs | 18 ++--- API_SQLuedo/API/Program.cs | 10 +-- .../API/Service/InquiryDataServiceAPI.cs | 12 ++-- .../API/Service/LessonDataServiceAPI.cs | 14 ++-- .../API/Service/ParagraphDataServiceAPI.cs | 12 ++-- .../API/Service/SuccessDataServiceAPI.cs | 12 ++-- API_SQLuedo/API/Service/UserDataServiceAPI.cs | 12 ++-- API_SQLuedo/DbContextLib/UserDbContext.cs | 12 ++-- API_SQLuedo/Dto/BlackListDTO.cs | 8 +-- API_SQLuedo/Dto/ContentLessonDTO.cs | 16 ++--- API_SQLuedo/Dto/InquiryDTO.cs | 8 +-- API_SQLuedo/Dto/InquiryTableDTO.cs | 6 +- API_SQLuedo/Dto/LessonDTO.cs | 10 +-- API_SQLuedo/Dto/NotepadDTO.cs | 8 +-- API_SQLuedo/Dto/ParagraphDTO.cs | 8 +-- API_SQLuedo/Dto/SolutionDTO.cs | 8 +-- API_SQLuedo/Dto/SuccessDTO.cs | 6 +- API_SQLuedo/Dto/UserDTO.cs | 8 +-- API_SQLuedo/Shared/Mapper/BlackListMapper.cs | 12 ++-- API_SQLuedo/Shared/Mapper/InquiryMapper.cs | 12 ++-- .../Shared/Mapper/InquiryTableMapper.cs | 12 ++-- API_SQLuedo/Shared/Mapper/LessonMapper.cs | 12 ++-- API_SQLuedo/Shared/Mapper/NotepadMapper.cs | 12 ++-- API_SQLuedo/Shared/Mapper/ParagraphMapper.cs | 12 ++-- API_SQLuedo/Shared/Mapper/SolutionMapper.cs | 12 ++-- API_SQLuedo/Shared/Mapper/SuccessMapper.cs | 12 ++-- API_SQLuedo/Shared/Mapper/UserMapper.cs | 12 ++-- .../StubbedContextLib/StubbedContext.cs | 16 ++--- API_SQLuedo/TestConsoleAPI/Program.cs | 66 +++++++++---------- 33 files changed, 229 insertions(+), 229 deletions(-) diff --git a/API_SQLuedo/API/Controllers/InquiriesController.cs b/API_SQLuedo/API/Controllers/InquiriesController.cs index d35db6d..14ad6fc 100644 --- a/API_SQLuedo/API/Controllers/InquiriesController.cs +++ b/API_SQLuedo/API/Controllers/InquiriesController.cs @@ -13,18 +13,18 @@ namespace API.Controllers [ApiController] public class InquiriesController : Controller { - private readonly IInquiryService _inquiryDataService; + private readonly IInquiryService _inquiryDataService; private readonly ILogger _logger; - public InquiriesController(IInquiryService inquiryDataService, ILogger logger) + public InquiriesController(IInquiryService inquiryDataService, ILogger logger) { _inquiryDataService = inquiryDataService; _logger = logger; } [HttpGet("inquiries/{page:int}/{number:int}/{orderCriteria}")] - [ProducesResponseType(typeof(InquiryDTO), 200)] + [ProducesResponseType(typeof(InquiryDto), 200)] [ProducesResponseType(typeof(string), 204)] public IActionResult GetInquiries(int page, int number, InquiryOrderCriteria orderCriteria) { @@ -40,7 +40,7 @@ namespace API.Controllers } [HttpGet("inquiry/{id:int}")] - [ProducesResponseType(typeof(InquiryDTO), 200)] + [ProducesResponseType(typeof(InquiryDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetInquiryById(int id) { @@ -57,7 +57,7 @@ namespace API.Controllers } [HttpGet("inquiry/{title:alpha}")] - [ProducesResponseType(typeof(InquiryDTO), 200)] + [ProducesResponseType(typeof(InquiryDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetInquiryByTitle(string title) { @@ -74,7 +74,7 @@ namespace API.Controllers } [HttpDelete("inquiry/{id:int}")] - [ProducesResponseType(typeof(InquiryDTO), 200)] + [ProducesResponseType(typeof(InquiryDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult DeleteInquiry(int id) { @@ -92,9 +92,9 @@ namespace API.Controllers } [HttpPost] - [ProducesResponseType(typeof(InquiryDTO), 201)] + [ProducesResponseType(typeof(InquiryDto), 201)] [ProducesResponseType(typeof(string), 400)] - public IActionResult CreateInquiry([FromBody] InquiryDTO dto) + public IActionResult CreateInquiry([FromBody] InquiryDto dto) { if (dto.Title == null || dto.Description == null) { @@ -109,10 +109,10 @@ namespace API.Controllers } [HttpPut("inquiry/{id:int}")] - [ProducesResponseType(typeof(InquiryDTO), 200)] + [ProducesResponseType(typeof(InquiryDto), 200)] [ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 404)] - public IActionResult UpdateInquiry(int id, [FromBody] InquiryDTO inquiryDTO) + public IActionResult UpdateInquiry(int id, [FromBody] InquiryDto inquiryDTO) { if (id != inquiryDTO.Id) { diff --git a/API_SQLuedo/API/Controllers/LessonsController.cs b/API_SQLuedo/API/Controllers/LessonsController.cs index dfbbd14..827db2f 100644 --- a/API_SQLuedo/API/Controllers/LessonsController.cs +++ b/API_SQLuedo/API/Controllers/LessonsController.cs @@ -13,18 +13,18 @@ namespace API.Controllers [ApiController] public class LessonsController : Controller { - private readonly ILessonService _lessonDataService; + private readonly ILessonService _lessonDataService; private readonly ILogger _logger; - public LessonsController(ILessonService lessonDataService, ILogger logger) + public LessonsController(ILessonService lessonDataService, ILogger logger) { _lessonDataService = lessonDataService; _logger = logger; } [HttpGet("lessons/{page:int}/{number:int}/{orderCriteria}")] - [ProducesResponseType(typeof(LessonDTO), 200)] + [ProducesResponseType(typeof(LessonDto), 200)] [ProducesResponseType(typeof(string), 204)] public IActionResult GetLessons(int page, int number, LessonOrderCriteria orderCriteria) { @@ -40,7 +40,7 @@ namespace API.Controllers } [HttpGet("lesson/{id:int}")] - [ProducesResponseType(typeof(LessonDTO), 200)] + [ProducesResponseType(typeof(LessonDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetLessonById(int id) { @@ -57,7 +57,7 @@ namespace API.Controllers } [HttpGet("lesson/{title:alpha}")] - [ProducesResponseType(typeof(LessonDTO), 200)] + [ProducesResponseType(typeof(LessonDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetLessonByTitle(string title) { @@ -74,7 +74,7 @@ namespace API.Controllers } [HttpDelete("lesson/{id:int}")] - [ProducesResponseType(typeof(LessonDTO), 200)] + [ProducesResponseType(typeof(LessonDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult DeleteLesson(int id) { @@ -92,9 +92,9 @@ namespace API.Controllers } [HttpPost] - [ProducesResponseType(typeof(LessonDTO), 201)] + [ProducesResponseType(typeof(LessonDto), 201)] [ProducesResponseType(typeof(string), 400)] - public IActionResult CreateLesson([FromBody] LessonDTO dto) + public IActionResult CreateLesson([FromBody] LessonDto dto) { if (dto.Title == null || dto.LastPublisher == null) { @@ -109,10 +109,10 @@ namespace API.Controllers } [HttpPut("lesson/{id:int}")] - [ProducesResponseType(typeof(LessonDTO), 200)] + [ProducesResponseType(typeof(LessonDto), 200)] [ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 404)] - public IActionResult UpdateLesson(int id, [FromBody] LessonDTO lessonDTO) + public IActionResult UpdateLesson(int id, [FromBody] LessonDto lessonDTO) { if (id != lessonDTO.Id) { diff --git a/API_SQLuedo/API/Controllers/ParagraphsController.cs b/API_SQLuedo/API/Controllers/ParagraphsController.cs index c6d64a5..5d934cc 100644 --- a/API_SQLuedo/API/Controllers/ParagraphsController.cs +++ b/API_SQLuedo/API/Controllers/ParagraphsController.cs @@ -13,11 +13,11 @@ namespace API.Controllers [ApiController] public class ParagraphsController : Controller { - private readonly IParagraphService _paragraphDataService; + private readonly IParagraphService _paragraphDataService; private readonly ILogger _logger; - public ParagraphsController(IParagraphService paragraphDataService, + public ParagraphsController(IParagraphService paragraphDataService, ILogger logger) { _paragraphDataService = paragraphDataService; @@ -25,7 +25,7 @@ namespace API.Controllers } [HttpGet("paragraphs/{page:int}/{number:int}/{orderCriteria}")] - [ProducesResponseType(typeof(ParagraphDTO), 200)] + [ProducesResponseType(typeof(ParagraphDto), 200)] [ProducesResponseType(typeof(string), 204)] public IActionResult GetParagraphs(int page, int number, ParagraphOrderCriteria orderCriteria) { @@ -41,7 +41,7 @@ namespace API.Controllers } [HttpGet("paragraph/{id:int}")] - [ProducesResponseType(typeof(ParagraphDTO), 200)] + [ProducesResponseType(typeof(ParagraphDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetParagraphById(int id) { @@ -58,7 +58,7 @@ namespace API.Controllers } [HttpGet("paragraph/{title:alpha}")] - [ProducesResponseType(typeof(ParagraphDTO), 200)] + [ProducesResponseType(typeof(ParagraphDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetParagraphByTitle(string title) { @@ -75,7 +75,7 @@ namespace API.Controllers } [HttpDelete("paragraph/{id:int}")] - [ProducesResponseType(typeof(ParagraphDTO), 200)] + [ProducesResponseType(typeof(ParagraphDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult DeleteParagraph(int id) { @@ -93,9 +93,9 @@ namespace API.Controllers } [HttpPost] - [ProducesResponseType(typeof(ParagraphDTO), 201)] + [ProducesResponseType(typeof(ParagraphDto), 201)] [ProducesResponseType(typeof(string), 400)] - public IActionResult CreateParagraph([FromBody] ParagraphDTO dto) + public IActionResult CreateParagraph([FromBody] ParagraphDto dto) { if (dto.Title == null || dto.Content == null || dto.Info == null || dto.Query == null || dto.Comment == null) @@ -112,10 +112,10 @@ namespace API.Controllers } [HttpPut("paragraph/{id:int}")] - [ProducesResponseType(typeof(ParagraphDTO), 200)] + [ProducesResponseType(typeof(ParagraphDto), 200)] [ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 404)] - public IActionResult UpdateParagraph(int id, [FromBody] ParagraphDTO paragraphDTO) + public IActionResult UpdateParagraph(int id, [FromBody] ParagraphDto paragraphDTO) { if (id != paragraphDTO.Id) { diff --git a/API_SQLuedo/API/Controllers/SuccessesController.cs b/API_SQLuedo/API/Controllers/SuccessesController.cs index 0a48938..25c6371 100644 --- a/API_SQLuedo/API/Controllers/SuccessesController.cs +++ b/API_SQLuedo/API/Controllers/SuccessesController.cs @@ -13,18 +13,18 @@ namespace API.Controllers [ApiController] public class SuccessesController : Controller { - private readonly ISuccessService _successDataService; + private readonly ISuccessService _successDataService; private readonly ILogger _logger; - public SuccessesController(ISuccessService successDataService, ILogger logger) + public SuccessesController(ISuccessService successDataService, ILogger logger) { _successDataService = successDataService; _logger = logger; } [HttpGet("successes/{page:int}/{number:int}/{orderCriteria}")] - [ProducesResponseType(typeof(SuccessDTO), 200)] + [ProducesResponseType(typeof(SuccessDto), 200)] [ProducesResponseType(typeof(string), 204)] public IActionResult GetSuccesses(int page, int number, SuccessOrderCriteria orderCriteria) { @@ -40,7 +40,7 @@ namespace API.Controllers } [HttpGet("success/user/{id:int}")] - [ProducesResponseType(typeof(SuccessDTO), 200)] + [ProducesResponseType(typeof(SuccessDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetSuccessByUserId(int id) { @@ -57,7 +57,7 @@ namespace API.Controllers } [HttpGet("success/inquiry/{id:int}")] - [ProducesResponseType(typeof(SuccessDTO), 200)] + [ProducesResponseType(typeof(SuccessDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetSuccessByInquiryId(int id) { @@ -75,7 +75,7 @@ namespace API.Controllers } [HttpDelete("success/{idUser:int}/{idInquiry:int}")] - [ProducesResponseType(typeof(SuccessDTO), 200)] + [ProducesResponseType(typeof(SuccessDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult DeleteSuccess(int idUser, int idInquiry) { @@ -93,9 +93,9 @@ namespace API.Controllers } [HttpPost] - [ProducesResponseType(typeof(SuccessDTO), 201)] + [ProducesResponseType(typeof(SuccessDto), 201)] [ProducesResponseType(typeof(string), 400)] - public IActionResult CreateSuccess([FromBody] SuccessDTO dto) + public IActionResult CreateSuccess([FromBody] SuccessDto dto) { /*if (dto.UserId == null || dto.InquiryId == null) { @@ -109,10 +109,10 @@ namespace API.Controllers } [HttpPut("success/{idUser:int}/{idInquiry:int}")] - [ProducesResponseType(typeof(SuccessDTO), 200)] + [ProducesResponseType(typeof(SuccessDto), 200)] [ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 404)] - public IActionResult UpdateSuccess(int idUser, int idInquiry, [FromBody] SuccessDTO successDTO) + public IActionResult UpdateSuccess(int idUser, int idInquiry, [FromBody] SuccessDto successDTO) { if (idUser != successDTO.UserId || idInquiry != successDTO.InquiryId) { diff --git a/API_SQLuedo/API/Controllers/UserController.cs b/API_SQLuedo/API/Controllers/UserController.cs index 63fe068..6a9bc67 100644 --- a/API_SQLuedo/API/Controllers/UserController.cs +++ b/API_SQLuedo/API/Controllers/UserController.cs @@ -11,10 +11,10 @@ namespace API.Controllers [Authorize] [ApiVersion("1.0")] [ApiController] - public class UsersController(ILogger logger, IUserService userService) : ControllerBase + public class UsersController(ILogger logger, IUserService userService) : ControllerBase { [HttpGet("users/{page:int}/{number:int}")] - [ProducesResponseType(typeof(UserDTO), 200)] + [ProducesResponseType(typeof(UserDto), 200)] [ProducesResponseType(typeof(string), 204)] public IActionResult GetUsers(int page, int number, UserOrderCriteria orderCriteria) { @@ -30,7 +30,7 @@ namespace API.Controllers } [HttpGet("user/{id:int}")] - [ProducesResponseType(typeof(UserDTO), 200)] + [ProducesResponseType(typeof(UserDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetUserById(int id) { @@ -47,7 +47,7 @@ namespace API.Controllers } [HttpGet("user/{username:alpha}")] - [ProducesResponseType(typeof(UserDTO), 200)] + [ProducesResponseType(typeof(UserDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult GetUserByUsername(string username) { @@ -64,7 +64,7 @@ namespace API.Controllers } [HttpDelete("user/{id:int}")] - [ProducesResponseType(typeof(UserDTO), 200)] + [ProducesResponseType(typeof(UserDto), 200)] [ProducesResponseType(typeof(string), 404)] public IActionResult DeleteUser(int id) { @@ -82,9 +82,9 @@ namespace API.Controllers } [HttpPost] - [ProducesResponseType(typeof(UserDTO), 201)] + [ProducesResponseType(typeof(UserDto), 201)] [ProducesResponseType(typeof(string), 400)] - public IActionResult CreateUser([FromBody] UserDTO dto) + public IActionResult CreateUser([FromBody] UserDto dto) { if (dto.Username == null || dto.Password == null || dto.Email == null) { @@ -100,10 +100,10 @@ namespace API.Controllers } [HttpPut("user/{id:int}")] - [ProducesResponseType(typeof(UserDTO), 200)] + [ProducesResponseType(typeof(UserDto), 200)] [ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 404)] - public IActionResult UpdateUser(int id, [FromBody] UserDTO userDto) + public IActionResult UpdateUser(int id, [FromBody] UserDto userDto) { if (id != userDto.Id) { diff --git a/API_SQLuedo/API/Program.cs b/API_SQLuedo/API/Program.cs index a2ef3df..8f6c77d 100644 --- a/API_SQLuedo/API/Program.cs +++ b/API_SQLuedo/API/Program.cs @@ -20,19 +20,19 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddScoped, UserDataService>(); -builder.Services.AddScoped, UserDataServiceApi>(); +builder.Services.AddScoped, UserDataServiceApi>(); builder.Services.AddScoped, InquiryDataService>(); -builder.Services.AddScoped, InquiryDataServiceApi>(); +builder.Services.AddScoped, InquiryDataServiceApi>(); builder.Services.AddScoped, ParagraphDataService>(); -builder.Services.AddScoped, ParagraphDataServiceApi>(); +builder.Services.AddScoped, ParagraphDataServiceApi>(); builder.Services.AddScoped, SuccessDataService>(); -builder.Services.AddScoped, SuccessDataServiceApi>(); +builder.Services.AddScoped, SuccessDataServiceApi>(); builder.Services.AddScoped, LessonDataService>(); -builder.Services.AddScoped, LessonDataServiceApi>(); +builder.Services.AddScoped, LessonDataServiceApi>(); builder.Services.AddDbContext(); builder.Services.AddDbContext(options => options.UseInMemoryDatabase("appDb")); diff --git a/API_SQLuedo/API/Service/InquiryDataServiceAPI.cs b/API_SQLuedo/API/Service/InquiryDataServiceAPI.cs index eb69a91..3bc935b 100644 --- a/API_SQLuedo/API/Service/InquiryDataServiceAPI.cs +++ b/API_SQLuedo/API/Service/InquiryDataServiceAPI.cs @@ -6,14 +6,14 @@ using Shared.Mapper; namespace API.Service; -public class InquiryDataServiceApi(IInquiryService inquiryService) : IInquiryService +public class InquiryDataServiceApi(IInquiryService inquiryService) : IInquiryService { - public InquiryDTO UpdateInquiry(int id, InquiryDTO inquiry) + public InquiryDto UpdateInquiry(int id, InquiryDto inquiry) { return inquiryService.UpdateInquiry(id, inquiry.FromDTOToEntity()).FromEntityToDTO(); } - public InquiryDTO CreateInquiry(string title, string description, bool isUser) + public InquiryDto CreateInquiry(string title, string description, bool isUser) { return inquiryService.CreateInquiry(title, description, isUser).FromEntityToDTO(); } @@ -23,13 +23,13 @@ public class InquiryDataServiceApi(IInquiryService inquiryService return inquiryService.DeleteInquiry(id); } - public IEnumerable GetInquiries(int page, int number, InquiryOrderCriteria orderCriteria) + public IEnumerable GetInquiries(int page, int number, InquiryOrderCriteria orderCriteria) { var inquiries = inquiryService.GetInquiries(page, number, orderCriteria); return inquiries.Select(i => i.FromEntityToDTO()).ToList(); } - public InquiryDTO GetInquiryById(int id) => inquiryService.GetInquiryById(id).FromEntityToDTO(); + public InquiryDto GetInquiryById(int id) => inquiryService.GetInquiryById(id).FromEntityToDTO(); - public InquiryDTO GetInquiryByTitle(string title) => inquiryService.GetInquiryByTitle(title).FromEntityToDTO(); + public InquiryDto GetInquiryByTitle(string title) => inquiryService.GetInquiryByTitle(title).FromEntityToDTO(); } \ No newline at end of file diff --git a/API_SQLuedo/API/Service/LessonDataServiceAPI.cs b/API_SQLuedo/API/Service/LessonDataServiceAPI.cs index 391d081..e4fa615 100644 --- a/API_SQLuedo/API/Service/LessonDataServiceAPI.cs +++ b/API_SQLuedo/API/Service/LessonDataServiceAPI.cs @@ -6,26 +6,26 @@ using Shared.Mapper; namespace API.Service; -public class LessonDataServiceApi(ILessonService lessonService) : ILessonService +public class LessonDataServiceApi(ILessonService lessonService) : ILessonService { - public IEnumerable GetLessons(int page, int number, LessonOrderCriteria orderCriteria) + public IEnumerable GetLessons(int page, int number, LessonOrderCriteria orderCriteria) { var lessonsEntities = lessonService.GetLessons(page, number, orderCriteria); return lessonsEntities.Select(e => e.FromEntityToDTO()).ToList(); } - public LessonDTO GetLessonById(int id) => lessonService.GetLessonById(id).FromEntityToDTO(); + public LessonDto GetLessonById(int id) => lessonService.GetLessonById(id).FromEntityToDTO(); - public LessonDTO GetLessonByTitle(string title) => lessonService.GetLessonByTitle(title).FromEntityToDTO(); + public LessonDto GetLessonByTitle(string title) => lessonService.GetLessonByTitle(title).FromEntityToDTO(); public bool DeleteLesson(int id) => lessonService.DeleteLesson(id); - public LessonDTO UpdateLesson(int id, LessonDTO lesson) => + public LessonDto UpdateLesson(int id, LessonDto lesson) => lessonService.UpdateLesson(id, lesson.FromDTOToEntity()).FromEntityToDTO(); - public LessonDTO UpdateLesson(int id, LessonEntity lesson) => + public LessonDto UpdateLesson(int id, LessonEntity lesson) => lessonService.UpdateLesson(id, lesson).FromEntityToDTO(); - public LessonDTO CreateLesson(string title, string lastPublisher, DateOnly? lastEdit) => + public LessonDto CreateLesson(string title, string lastPublisher, DateOnly? lastEdit) => lessonService.CreateLesson(title, lastPublisher, lastEdit).FromEntityToDTO(); } \ No newline at end of file diff --git a/API_SQLuedo/API/Service/ParagraphDataServiceAPI.cs b/API_SQLuedo/API/Service/ParagraphDataServiceAPI.cs index 3892c65..f51d68e 100644 --- a/API_SQLuedo/API/Service/ParagraphDataServiceAPI.cs +++ b/API_SQLuedo/API/Service/ParagraphDataServiceAPI.cs @@ -7,25 +7,25 @@ using Shared.Mapper; namespace API.Service; public class ParagraphDataServiceApi(IParagraphService paragraphService) - : IParagraphService + : IParagraphService { - public IEnumerable GetParagraphs(int page, int number, ParagraphOrderCriteria orderCriteria) + public IEnumerable GetParagraphs(int page, int number, ParagraphOrderCriteria orderCriteria) { var paragraphsEntities = paragraphService.GetParagraphs(page, number, orderCriteria); return paragraphsEntities.Select(e => e.FromEntityToDTO()).ToList(); } - public ParagraphDTO GetParagraphById(int id) => paragraphService.GetParagraphById(id).FromEntityToDTO(); + public ParagraphDto GetParagraphById(int id) => paragraphService.GetParagraphById(id).FromEntityToDTO(); - public ParagraphDTO GetParagraphByTitle(string title) => + public ParagraphDto GetParagraphByTitle(string title) => paragraphService.GetParagraphByTitle(title).FromEntityToDTO(); public bool DeleteParagraph(int id) => paragraphService.DeleteParagraph(id); - public ParagraphDTO UpdateParagraph(int id, ParagraphDTO paragraph) => + public ParagraphDto UpdateParagraph(int id, ParagraphDto paragraph) => paragraphService.UpdateParagraph(id, paragraph.FromDTOToEntity()).FromEntityToDTO(); - public ParagraphDTO CreateParagraph(string title, string content, string info, string query, string comment, + public ParagraphDto CreateParagraph(string title, string content, string info, string query, string comment, int lessonId) => paragraphService.CreateParagraph(title, content, info, query, comment, lessonId).FromEntityToDTO(); } \ No newline at end of file diff --git a/API_SQLuedo/API/Service/SuccessDataServiceAPI.cs b/API_SQLuedo/API/Service/SuccessDataServiceAPI.cs index 047203d..a467bc5 100644 --- a/API_SQLuedo/API/Service/SuccessDataServiceAPI.cs +++ b/API_SQLuedo/API/Service/SuccessDataServiceAPI.cs @@ -6,23 +6,23 @@ using Shared.Mapper; namespace API.Service; -public class SuccessDataServiceApi(ISuccessService sucessService) : ISuccessService +public class SuccessDataServiceApi(ISuccessService sucessService) : ISuccessService { - public IEnumerable GetSuccesses(int page, int number, SuccessOrderCriteria orderCriteria) + public IEnumerable GetSuccesses(int page, int number, SuccessOrderCriteria orderCriteria) { var successesEntities = sucessService.GetSuccesses(page, number, orderCriteria); return successesEntities.Select(e => e.FromEntityToDTO()).ToList(); } - public IEnumerable GetSuccessesByUserId(int id) => sucessService.GetSuccessesByUserId(id).Select(s => s.FromEntityToDTO()); + public IEnumerable GetSuccessesByUserId(int id) => sucessService.GetSuccessesByUserId(id).Select(s => s.FromEntityToDTO()); - public IEnumerable GetSuccessesByInquiryId(int id) => sucessService.GetSuccessesByInquiryId(id).Select(s => s.FromEntityToDTO()); + public IEnumerable GetSuccessesByInquiryId(int id) => sucessService.GetSuccessesByInquiryId(id).Select(s => s.FromEntityToDTO()); public bool DeleteSuccess(int idUser, int idInquiry) => sucessService.DeleteSuccess(idUser, idInquiry); - public SuccessDTO UpdateSuccess(int idUser, int idInquiry, SuccessDTO success) => + public SuccessDto UpdateSuccess(int idUser, int idInquiry, SuccessDto success) => sucessService.UpdateSuccess(idUser, idInquiry, success.FromDTOToEntity()).FromEntityToDTO(); - public SuccessDTO CreateSuccess(int userId, int inquiryId, bool isFinished) => + public SuccessDto CreateSuccess(int userId, int inquiryId, bool isFinished) => sucessService.CreateSuccess(userId, inquiryId, isFinished).FromEntityToDTO(); } \ No newline at end of file diff --git a/API_SQLuedo/API/Service/UserDataServiceAPI.cs b/API_SQLuedo/API/Service/UserDataServiceAPI.cs index 482a679..04a58c4 100644 --- a/API_SQLuedo/API/Service/UserDataServiceAPI.cs +++ b/API_SQLuedo/API/Service/UserDataServiceAPI.cs @@ -6,23 +6,23 @@ using Shared.Mapper; namespace API.Service; -public class UserDataServiceApi(IUserService userService) : IUserService +public class UserDataServiceApi(IUserService userService) : IUserService { - public IEnumerable GetUsers(int page, int number, UserOrderCriteria orderCriteria) + public IEnumerable GetUsers(int page, int number, UserOrderCriteria orderCriteria) { var usersEntities = userService.GetUsers(page, number, orderCriteria); return usersEntities.Select(e => e.FromEntityToDTO()).ToList(); } - public UserDTO GetUserById(int id) => userService.GetUserById(id).FromEntityToDTO(); + public UserDto GetUserById(int id) => userService.GetUserById(id).FromEntityToDTO(); - public UserDTO GetUserByUsername(string username) => userService.GetUserByUsername(username).FromEntityToDTO(); + public UserDto GetUserByUsername(string username) => userService.GetUserByUsername(username).FromEntityToDTO(); public bool DeleteUser(int id) => userService.DeleteUser(id); - public UserDTO UpdateUser(int id, UserDTO user) => + public UserDto UpdateUser(int id, UserDto user) => userService.UpdateUser(id, user.FromDTOToEntity()).FromEntityToDTO(); - public UserDTO CreateUser(string username, string password, string email, bool isAdmin) => + public UserDto CreateUser(string username, string password, string email, bool isAdmin) => userService.CreateUser(username, password, email, isAdmin).FromEntityToDTO(); } \ No newline at end of file diff --git a/API_SQLuedo/DbContextLib/UserDbContext.cs b/API_SQLuedo/DbContextLib/UserDbContext.cs index 2334377..b4de5c2 100644 --- a/API_SQLuedo/DbContextLib/UserDbContext.cs +++ b/API_SQLuedo/DbContextLib/UserDbContext.cs @@ -31,15 +31,15 @@ namespace DbContextLib base.OnConfiguring(optionsBuilder); } - protected override void OnModelCreating(ModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder builder) { // Permet d'avoir les champs de la classe mère dans les classes filles et de ne pas avoir de table pour la classe mère - modelBuilder.Entity().UseTpcMappingStrategy(); + builder.Entity().UseTpcMappingStrategy(); - modelBuilder.Entity().HasKey(s => s.UserId); - modelBuilder.Entity().HasKey(s => s.InquiryId); - modelBuilder.Entity().HasKey(s => s.Id); - base.OnModelCreating(modelBuilder); + builder.Entity().HasKey(s => s.UserId); + builder.Entity().HasKey(s => s.InquiryId); + builder.Entity().HasKey(s => s.Id); + base.OnModelCreating(builder); } } } \ No newline at end of file diff --git a/API_SQLuedo/Dto/BlackListDTO.cs b/API_SQLuedo/Dto/BlackListDTO.cs index a8a5a63..99951c0 100644 --- a/API_SQLuedo/Dto/BlackListDTO.cs +++ b/API_SQLuedo/Dto/BlackListDTO.cs @@ -1,12 +1,12 @@ namespace Dto; -public class BlackListDTO +public class BlackListDto { - public string Email { get; set; } + public string? Email { get; set; } public DateOnly ExpirationDate { get; set; } - public BlackListDTO() {} - public BlackListDTO(string email, DateOnly expirationDate) + public BlackListDto() {} + public BlackListDto(string email, DateOnly expirationDate) { Email = email; ExpirationDate = expirationDate; diff --git a/API_SQLuedo/Dto/ContentLessonDTO.cs b/API_SQLuedo/Dto/ContentLessonDTO.cs index 357d634..98a9faf 100644 --- a/API_SQLuedo/Dto/ContentLessonDTO.cs +++ b/API_SQLuedo/Dto/ContentLessonDTO.cs @@ -1,13 +1,13 @@ namespace Dto; -public abstract class ContentLessonDTO +public abstract class ContentLessonDto { public int Id { get; set; } public string ContentContent { get; set; } public string ContentTitle { get; set; } public int LessonId { get; set; } - protected ContentLessonDTO(int id, string contentContent, string contentTitle, int lessonId) + protected ContentLessonDto(int id, string contentContent, string contentTitle, int lessonId) { Id = id; ContentContent = contentContent; @@ -15,14 +15,14 @@ public abstract class ContentLessonDTO LessonId = lessonId; } - protected ContentLessonDTO(string contentContent, string contentTitle, int lessonId) + protected ContentLessonDto(string contentContent, string contentTitle, int lessonId) { ContentContent = contentContent; ContentTitle = contentTitle; LessonId = lessonId; - } - - protected ContentLessonDTO() - { - } + } + + protected ContentLessonDto() + { + } } \ No newline at end of file diff --git a/API_SQLuedo/Dto/InquiryDTO.cs b/API_SQLuedo/Dto/InquiryDTO.cs index e747231..8aa3c6b 100644 --- a/API_SQLuedo/Dto/InquiryDTO.cs +++ b/API_SQLuedo/Dto/InquiryDTO.cs @@ -1,6 +1,6 @@ namespace Dto; -public class InquiryDTO +public class InquiryDto { public int Id { get; } @@ -10,8 +10,8 @@ public class InquiryDTO public bool IsUser { get; set; } - public InquiryDTO(){} - public InquiryDTO(int id, string title, string description, bool isUser) + public InquiryDto(){} + public InquiryDto(int id, string title, string description, bool isUser) { Id = id; Title = title; @@ -19,7 +19,7 @@ public class InquiryDTO IsUser = isUser; } - public InquiryDTO(string title, string description, bool isUser) + public InquiryDto(string title, string description, bool isUser) { Title = title; Description = description; diff --git a/API_SQLuedo/Dto/InquiryTableDTO.cs b/API_SQLuedo/Dto/InquiryTableDTO.cs index 6c28790..730b933 100644 --- a/API_SQLuedo/Dto/InquiryTableDTO.cs +++ b/API_SQLuedo/Dto/InquiryTableDTO.cs @@ -1,16 +1,16 @@ namespace Dto; -public class InquiryTableDTO +public class InquiryTableDto { public int OwnerId { get; set; } public string DatabaseName { get; set; } public string ConnectionInfo { get; set; } - public InquiryTableDTO() + public InquiryTableDto() { } - public InquiryTableDTO(int ownerId, string databaseName, string connectionInfo) + public InquiryTableDto(int ownerId, string databaseName, string connectionInfo) { OwnerId = ownerId; DatabaseName = databaseName; diff --git a/API_SQLuedo/Dto/LessonDTO.cs b/API_SQLuedo/Dto/LessonDTO.cs index ab8008f..db96681 100644 --- a/API_SQLuedo/Dto/LessonDTO.cs +++ b/API_SQLuedo/Dto/LessonDTO.cs @@ -1,18 +1,18 @@ namespace Dto; -public class LessonDTO +public class LessonDto { public int Id { get; } public string? Title { get; set; } public string? LastPublisher { get; set; } public DateOnly? LastEdit { get; set; } - public ICollection Content { get; set; } = new List(); + public ICollection Content { get; set; } = new List(); - public LessonDTO() + public LessonDto() { } - public LessonDTO(int id, string title, string lastPublisher, DateOnly? lastEdit) + public LessonDto(int id, string title, string lastPublisher, DateOnly? lastEdit) { Id = id; Title = title; @@ -20,7 +20,7 @@ public class LessonDTO LastEdit = lastEdit; } - public LessonDTO(string title, string lastPublisher, DateOnly? lastEdit) + public LessonDto(string title, string lastPublisher, DateOnly? lastEdit) { Title = title; LastPublisher = lastPublisher; diff --git a/API_SQLuedo/Dto/NotepadDTO.cs b/API_SQLuedo/Dto/NotepadDTO.cs index 0c14762..1b143b1 100644 --- a/API_SQLuedo/Dto/NotepadDTO.cs +++ b/API_SQLuedo/Dto/NotepadDTO.cs @@ -1,17 +1,17 @@ namespace Dto; -public class NotepadDTO +public class NotepadDto { public int Id { get; set; } public int UserId { get; set; } public int InquiryId { get; set; } public string Notes { get; set; } - public NotepadDTO() + public NotepadDto() { } - public NotepadDTO(int id, int userId, int inquiryId, string notes) + public NotepadDto(int id, int userId, int inquiryId, string notes) { Id = id; UserId = userId; @@ -19,7 +19,7 @@ public class NotepadDTO Notes = notes; } - public NotepadDTO(int userId, int inquiryId, string notes) + public NotepadDto(int userId, int inquiryId, string notes) { UserId = userId; InquiryId = inquiryId; diff --git a/API_SQLuedo/Dto/ParagraphDTO.cs b/API_SQLuedo/Dto/ParagraphDTO.cs index 9e08d8f..2c7c560 100644 --- a/API_SQLuedo/Dto/ParagraphDTO.cs +++ b/API_SQLuedo/Dto/ParagraphDTO.cs @@ -1,6 +1,6 @@ namespace Dto; -public class ParagraphDTO : ContentLessonDTO +public class ParagraphDto : ContentLessonDto { public string Title { get; set; } public string Content { get; set; } @@ -8,7 +8,7 @@ public class ParagraphDTO : ContentLessonDTO public string Query { get; set; } public string Comment { get; set; } - public ParagraphDTO(string title, string content, string info, string query, string comment, int lessonId) : + public ParagraphDto(string title, string content, string info, string query, string comment, int lessonId) : base(content, title, lessonId) { @@ -19,7 +19,7 @@ public class ParagraphDTO : ContentLessonDTO Comment = comment; } - public ParagraphDTO(int id, string title, string content, string info, string query, string comment, int lessonId) : + public ParagraphDto(int id, string title, string content, string info, string query, string comment, int lessonId) : base(id, content, title, lessonId) { @@ -31,7 +31,7 @@ public class ParagraphDTO : ContentLessonDTO Comment = comment; } - public ParagraphDTO() : base() + public ParagraphDto() : base() { } } \ No newline at end of file diff --git a/API_SQLuedo/Dto/SolutionDTO.cs b/API_SQLuedo/Dto/SolutionDTO.cs index e5087c2..951a0e7 100644 --- a/API_SQLuedo/Dto/SolutionDTO.cs +++ b/API_SQLuedo/Dto/SolutionDTO.cs @@ -1,6 +1,6 @@ namespace Dto; -public class SolutionDTO +public class SolutionDto { public int OwnerId { get; set; } public string MurdererFirstName { get; set; } @@ -9,11 +9,11 @@ public class SolutionDTO public string MurderWeapon { get; set; } public string Explanation { get; set; } - public SolutionDTO() + public SolutionDto() { } - public SolutionDTO(int ownerId, string murdererFirstName, string murdererLastName, string murderPlace, + public SolutionDto(int ownerId, string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, string explanation) { OwnerId = ownerId; @@ -24,7 +24,7 @@ public class SolutionDTO Explanation = explanation; } - public SolutionDTO(string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, + public SolutionDto(string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, string explanation) { MurdererFirstName = murdererFirstName; diff --git a/API_SQLuedo/Dto/SuccessDTO.cs b/API_SQLuedo/Dto/SuccessDTO.cs index 579f209..21efd54 100644 --- a/API_SQLuedo/Dto/SuccessDTO.cs +++ b/API_SQLuedo/Dto/SuccessDTO.cs @@ -1,16 +1,16 @@ namespace Dto; -public class SuccessDTO +public class SuccessDto { public int UserId { get; set; } public int InquiryId { get; set; } public bool IsFinished { get; set; } - public SuccessDTO() + public SuccessDto() { } - public SuccessDTO(int userId, int inquiryId, bool isFinished) + public SuccessDto(int userId, int inquiryId, bool isFinished) { UserId = userId; InquiryId = inquiryId; diff --git a/API_SQLuedo/Dto/UserDTO.cs b/API_SQLuedo/Dto/UserDTO.cs index 85d6ac7..43b0cfc 100644 --- a/API_SQLuedo/Dto/UserDTO.cs +++ b/API_SQLuedo/Dto/UserDTO.cs @@ -1,6 +1,6 @@ namespace Dto; -public class UserDTO +public class UserDto { public int Id { get; set; } public string Username { get; set; } @@ -8,11 +8,11 @@ public class UserDTO public string Email { get; set; } public bool IsAdmin { get; set; } - public UserDTO() + public UserDto() { } - public UserDTO(int id, string username, string password, string email, bool isAdmin) + public UserDto(int id, string username, string password, string email, bool isAdmin) { Id = id; Username = username; @@ -21,7 +21,7 @@ public class UserDTO IsAdmin = isAdmin; } - public UserDTO(string username, string password, string email, bool isAdmin) + public UserDto(string username, string password, string email, bool isAdmin) { Username = username; Password = password; diff --git a/API_SQLuedo/Shared/Mapper/BlackListMapper.cs b/API_SQLuedo/Shared/Mapper/BlackListMapper.cs index 77427c4..a3187a3 100644 --- a/API_SQLuedo/Shared/Mapper/BlackListMapper.cs +++ b/API_SQLuedo/Shared/Mapper/BlackListMapper.cs @@ -6,17 +6,17 @@ namespace Shared.Mapper; public static class BlackListMapper { - public static BlackListDTO FromModelToDTO(this BlackList model) + public static BlackListDto FromModelToDTO(this BlackList model) { - return new BlackListDTO(model.Email, model.ExpirationDate); + return new BlackListDto(model.Email, model.ExpirationDate); } - public static BlackListDTO FromEntityToDTO(this BlackListEntity ent) + public static BlackListDto FromEntityToDTO(this BlackListEntity ent) { - return new BlackListDTO(ent.Email, ent.ExpirationDate); + return new BlackListDto(ent.Email, ent.ExpirationDate); } - public static BlackList FromDTOToModel(this BlackListDTO dto) + public static BlackList FromDTOToModel(this BlackListDto dto) { return new BlackList(dto.Email, dto.ExpirationDate); } @@ -26,7 +26,7 @@ public static class BlackListMapper return new BlackList(ent.Email, ent.ExpirationDate); } - public static BlackListEntity FromDTOToEntity(this BlackListDTO dto) + public static BlackListEntity FromDTOToEntity(this BlackListDto dto) { return new BlackListEntity(dto.Email, dto.ExpirationDate); } diff --git a/API_SQLuedo/Shared/Mapper/InquiryMapper.cs b/API_SQLuedo/Shared/Mapper/InquiryMapper.cs index 90f1f15..af57277 100644 --- a/API_SQLuedo/Shared/Mapper/InquiryMapper.cs +++ b/API_SQLuedo/Shared/Mapper/InquiryMapper.cs @@ -6,7 +6,7 @@ namespace Shared.Mapper; public static class InquiryMapper { - public static Inquiry FromDTOToModel(this InquiryDTO inqDto) + public static Inquiry FromDTOToModel(this InquiryDto inqDto) { return new Inquiry(inqDto.Id, inqDto.Title, inqDto.Description, inqDto.IsUser); } @@ -22,18 +22,18 @@ public static class InquiryMapper return new InquiryEntity(inq.Id, inq.Title, inq.Description, inq.IsUser); } - public static InquiryEntity FromDTOToEntity(this InquiryDTO inqDto) + public static InquiryEntity FromDTOToEntity(this InquiryDto inqDto) { return new InquiryEntity(inqDto.Id, inqDto.Title, inqDto.Description, inqDto.IsUser); } - public static InquiryDTO FromModelToDTO(this Inquiry inq) + public static InquiryDto FromModelToDTO(this Inquiry inq) { - return new InquiryDTO(inq.Id, inq.Title, inq.Description, inq.IsUser); + return new InquiryDto(inq.Id, inq.Title, inq.Description, inq.IsUser); } - public static InquiryDTO FromEntityToDTO(this InquiryEntity inqEntity) + public static InquiryDto FromEntityToDTO(this InquiryEntity inqEntity) { - return new InquiryDTO(inqEntity.Id, inqEntity.Title, inqEntity.Description, inqEntity.IsUser); + return new InquiryDto(inqEntity.Id, inqEntity.Title, inqEntity.Description, inqEntity.IsUser); } } \ No newline at end of file diff --git a/API_SQLuedo/Shared/Mapper/InquiryTableMapper.cs b/API_SQLuedo/Shared/Mapper/InquiryTableMapper.cs index 3dc11ca..7469e28 100644 --- a/API_SQLuedo/Shared/Mapper/InquiryTableMapper.cs +++ b/API_SQLuedo/Shared/Mapper/InquiryTableMapper.cs @@ -6,7 +6,7 @@ namespace Shared.Mapper; public static class InquiryTableMapper { - public static InquiryTable FromDTOToModel(this InquiryTableDTO inqTDto) + public static InquiryTable FromDTOToModel(this InquiryTableDto inqTDto) { return new InquiryTable(inqTDto.OwnerId, inqTDto.ConnectionInfo, inqTDto.DatabaseName); } @@ -16,14 +16,14 @@ public static class InquiryTableMapper return new InquiryTable(inqTEntity.OwnerId, inqTEntity.ConnectionInfo, inqTEntity.DatabaseName); } - public static InquiryTableDTO FromModelToDTO(this InquiryTable inqT) + public static InquiryTableDto FromModelToDTO(this InquiryTable inqT) { - return new InquiryTableDTO(inqT.OwnerId, inqT.DatabaseName, inqT.ConnectionInfo); + return new InquiryTableDto(inqT.OwnerId, inqT.DatabaseName, inqT.ConnectionInfo); } - public static InquiryTableDTO FromEntityToDTO(this InquiryTableEntity inqTEntity) + public static InquiryTableDto FromEntityToDTO(this InquiryTableEntity inqTEntity) { - return new InquiryTableDTO(inqTEntity.OwnerId, inqTEntity.DatabaseName, inqTEntity.ConnectionInfo); + return new InquiryTableDto(inqTEntity.OwnerId, inqTEntity.DatabaseName, inqTEntity.ConnectionInfo); } public static InquiryTableEntity FromModelToEntity(this InquiryTable inqT) @@ -31,7 +31,7 @@ public static class InquiryTableMapper return new InquiryTableEntity(inqT.OwnerId, inqT.DatabaseName, inqT.ConnectionInfo); } - public static InquiryTableEntity FromDTOToEntity(this InquiryTableDTO dto) + public static InquiryTableEntity FromDTOToEntity(this InquiryTableDto dto) { return new InquiryTableEntity(dto.OwnerId, dto.DatabaseName, dto.ConnectionInfo); } diff --git a/API_SQLuedo/Shared/Mapper/LessonMapper.cs b/API_SQLuedo/Shared/Mapper/LessonMapper.cs index 80fdcb7..f218943 100644 --- a/API_SQLuedo/Shared/Mapper/LessonMapper.cs +++ b/API_SQLuedo/Shared/Mapper/LessonMapper.cs @@ -6,14 +6,14 @@ namespace Shared.Mapper; public static class LessonMapper { - public static LessonDTO FromModelToDTO(this Lesson model) + public static LessonDto FromModelToDTO(this Lesson model) { - return new LessonDTO(model.Id, model.Title, model.LastPublisher, model.LastEdit); + return new LessonDto(model.Id, model.Title, model.LastPublisher, model.LastEdit); } - public static LessonDTO FromEntityToDTO(this LessonEntity model) + public static LessonDto FromEntityToDTO(this LessonEntity model) { - return new LessonDTO(model.Id, model.Title, model.LastPublisher, model.LastEdit); + return new LessonDto(model.Id, model.Title, model.LastPublisher, model.LastEdit); } public static LessonEntity FromModelToEntity(this Lesson model) @@ -21,12 +21,12 @@ public static class LessonMapper return new LessonEntity(model.Id, model.Title, model.LastPublisher, model.LastEdit); } - public static LessonEntity FromDTOToEntity(this LessonDTO dto) + public static LessonEntity FromDTOToEntity(this LessonDto dto) { return new LessonEntity(dto.Id, dto.Title, dto.LastPublisher, dto.LastEdit); } - public static Lesson FromDTOToModel(this LessonDTO dto) + public static Lesson FromDTOToModel(this LessonDto dto) { return new Lesson(dto.Id, dto.Title, dto.LastPublisher, dto.LastEdit); } diff --git a/API_SQLuedo/Shared/Mapper/NotepadMapper.cs b/API_SQLuedo/Shared/Mapper/NotepadMapper.cs index 5de18a8..08ffce4 100644 --- a/API_SQLuedo/Shared/Mapper/NotepadMapper.cs +++ b/API_SQLuedo/Shared/Mapper/NotepadMapper.cs @@ -6,7 +6,7 @@ namespace Shared.Mapper; public static class NotepadMapper { - public static Notepad FromDTOToModel(this NotepadDTO dto) + public static Notepad FromDTOToModel(this NotepadDto dto) { return new Notepad(dto.Id, dto.UserId, dto.InquiryId, dto.Notes); } @@ -16,17 +16,17 @@ public static class NotepadMapper return new Notepad(ent.Id, ent.UserId, ent.InquiryId, ent.Notes); } - public static NotepadDTO FromModelToDTO(this Notepad not) + public static NotepadDto FromModelToDTO(this Notepad not) { - return new NotepadDTO(not.Id, not.UserId, not.InquiryId, not.Notes); + return new NotepadDto(not.Id, not.UserId, not.InquiryId, not.Notes); } - public static NotepadDTO FromEntityToDTO(this NotepadEntity ent) + public static NotepadDto FromEntityToDTO(this NotepadEntity ent) { - return new NotepadDTO(ent.Id, ent.UserId, ent.InquiryId, ent.Notes); + return new NotepadDto(ent.Id, ent.UserId, ent.InquiryId, ent.Notes); } - public static NotepadEntity FromDTOToEntity(this NotepadDTO dto) + public static NotepadEntity FromDTOToEntity(this NotepadDto dto) { return new NotepadEntity(dto.Id, new UserEntity(dto.UserId), dto.UserId, new InquiryEntity(dto.InquiryId), dto.Notes); diff --git a/API_SQLuedo/Shared/Mapper/ParagraphMapper.cs b/API_SQLuedo/Shared/Mapper/ParagraphMapper.cs index 3d029e5..cb9083b 100644 --- a/API_SQLuedo/Shared/Mapper/ParagraphMapper.cs +++ b/API_SQLuedo/Shared/Mapper/ParagraphMapper.cs @@ -6,7 +6,7 @@ namespace Shared.Mapper; public static class ParagraphMapper { - public static Paragraph FromDTOToModel(this ParagraphDTO dto) + public static Paragraph FromDTOToModel(this ParagraphDto dto) { return new Paragraph(dto.ContentTitle, dto.ContentContent, dto.Info, dto.Query, dto.Comment); } @@ -16,19 +16,19 @@ public static class ParagraphMapper return new Paragraph(model.ContentTitle, model.ContentContent, model.Info, model.Query, model.Comment); } - public static ParagraphDTO FromEntityToDTO(this ParagraphEntity model) + public static ParagraphDto FromEntityToDTO(this ParagraphEntity model) { - return new ParagraphDTO(model.Id, model.ContentTitle, model.ContentContent, model.Info, model.Query, + return new ParagraphDto(model.Id, model.ContentTitle, model.ContentContent, model.Info, model.Query, model.Comment, model.LessonId); } - public static ParagraphDTO FromModelToDTO(this Paragraph model) + public static ParagraphDto FromModelToDTO(this Paragraph model) { - return new ParagraphDTO(model.Id, model.ContentTitle, model.ContentContent, model.Info, model.Query, + return new ParagraphDto(model.Id, model.ContentTitle, model.ContentContent, model.Info, model.Query, model.Comment, model.LessonId); } - public static ParagraphEntity FromDTOToEntity(this ParagraphDTO dto) + public static ParagraphEntity FromDTOToEntity(this ParagraphDto dto) { return new ParagraphEntity(dto.Id, dto.ContentTitle, dto.ContentContent, dto.Info, dto.Query, dto.Comment, dto.LessonId); diff --git a/API_SQLuedo/Shared/Mapper/SolutionMapper.cs b/API_SQLuedo/Shared/Mapper/SolutionMapper.cs index 9f5f49a..3615528 100644 --- a/API_SQLuedo/Shared/Mapper/SolutionMapper.cs +++ b/API_SQLuedo/Shared/Mapper/SolutionMapper.cs @@ -6,7 +6,7 @@ namespace Shared.Mapper; public static class SolutionMapper { - public static Solution FromDTOToModel(this SolutionDTO dto) + public static Solution FromDTOToModel(this SolutionDto dto) { return new Solution(dto.OwnerId, dto.MurdererFirstName, dto.MurdererLastName, dto.MurderPlace, dto.MurderWeapon, dto.Explanation); @@ -18,15 +18,15 @@ public static class SolutionMapper entity.MurderWeapon, entity.Explaination); } - public static SolutionDTO FromModelToDTO(this Solution model) + public static SolutionDto FromModelToDTO(this Solution model) { - return new SolutionDTO(model.OwnerId, model.MurdererFirstName, model.MurdererLastName, model.MurderPlace, + return new SolutionDto(model.OwnerId, model.MurdererFirstName, model.MurdererLastName, model.MurderPlace, model.MurderWeapon, model.Explanation); } - public static SolutionDTO FromEntityToDTO(this SolutionEntity entity) + public static SolutionDto FromEntityToDTO(this SolutionEntity entity) { - return new SolutionDTO(entity.OwnerId, entity.MurdererFirstName, entity.MurdererLastName, entity.MurderPlace, + return new SolutionDto(entity.OwnerId, entity.MurdererFirstName, entity.MurdererLastName, entity.MurderPlace, entity.MurderWeapon, entity.Explaination); } @@ -36,7 +36,7 @@ public static class SolutionMapper model.MurdererLastName, model.MurderPlace, model.MurderWeapon, model.Explanation); } - public static SolutionEntity FromDTOToEntity(this SolutionDTO dto) + public static SolutionEntity FromDTOToEntity(this SolutionDto dto) { return new SolutionEntity(dto.OwnerId, new InquiryEntity(dto.OwnerId), dto.MurdererFirstName, dto.MurdererLastName, dto.MurderPlace, dto.MurderWeapon, dto.Explanation); diff --git a/API_SQLuedo/Shared/Mapper/SuccessMapper.cs b/API_SQLuedo/Shared/Mapper/SuccessMapper.cs index ea5ef02..8a9ebd3 100644 --- a/API_SQLuedo/Shared/Mapper/SuccessMapper.cs +++ b/API_SQLuedo/Shared/Mapper/SuccessMapper.cs @@ -6,7 +6,7 @@ namespace Shared.Mapper; public static class SuccessMapper { - public static Success FromDTOToModel(this SuccessDTO dto) + public static Success FromDTOToModel(this SuccessDto dto) { return new Success(dto.UserId, dto.InquiryId, dto.IsFinished); } @@ -16,17 +16,17 @@ public static class SuccessMapper return new Success(ent.UserId, ent.InquiryId, ent.IsFinished); } - public static SuccessDTO FromModelToDTO(this Success suc) + public static SuccessDto FromModelToDTO(this Success suc) { - return new SuccessDTO(suc.UserId, suc.InquiryId, suc.IsFinished); + return new SuccessDto(suc.UserId, suc.InquiryId, suc.IsFinished); } - public static SuccessDTO FromEntityToDTO(this SuccessEntity ent) + public static SuccessDto FromEntityToDTO(this SuccessEntity ent) { - return new SuccessDTO(ent.UserId, ent.InquiryId, ent.IsFinished); + return new SuccessDto(ent.UserId, ent.InquiryId, ent.IsFinished); } - public static SuccessEntity FromDTOToEntity(this SuccessDTO dto) + public static SuccessEntity FromDTOToEntity(this SuccessDto dto) { return new SuccessEntity(dto.UserId, new UserEntity(dto.UserId), dto.InquiryId, new InquiryEntity(dto.InquiryId), dto.IsFinished); diff --git a/API_SQLuedo/Shared/Mapper/UserMapper.cs b/API_SQLuedo/Shared/Mapper/UserMapper.cs index f915699..813931b 100644 --- a/API_SQLuedo/Shared/Mapper/UserMapper.cs +++ b/API_SQLuedo/Shared/Mapper/UserMapper.cs @@ -6,12 +6,12 @@ namespace Shared.Mapper; public static class UserMapper { - public static User FromDTOToModel(this UserDTO dto) + public static User FromDTOToModel(this UserDto dto) { return new User(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin); } - public static UserEntity FromDTOToEntity(this UserDTO dto) + public static UserEntity FromDTOToEntity(this UserDto dto) { return new UserEntity(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin); } @@ -21,14 +21,14 @@ public static class UserMapper return new User(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin); } - public static UserDTO FromEntityToDTO(this UserEntity entity) + public static UserDto FromEntityToDTO(this UserEntity entity) { - return new UserDTO(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin); + return new UserDto(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin); } - public static UserDTO FromModelToDTO(this User user) + public static UserDto FromModelToDTO(this User user) { - return new UserDTO(user.Id, user.Username, user.Password, user.Email, user.IsAdmin); + return new UserDto(user.Id, user.Username, user.Password, user.Email, user.IsAdmin); } public static UserEntity FromModelToEntity(this User user) diff --git a/API_SQLuedo/StubbedContextLib/StubbedContext.cs b/API_SQLuedo/StubbedContextLib/StubbedContext.cs index b5f09fd..818785d 100644 --- a/API_SQLuedo/StubbedContextLib/StubbedContext.cs +++ b/API_SQLuedo/StubbedContextLib/StubbedContext.cs @@ -12,10 +12,10 @@ public class StubbedContext : UserDbContext { } - protected override void OnModelCreating(ModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder builder) { - base.OnModelCreating(modelBuilder); - modelBuilder.Entity().HasData( + base.OnModelCreating(builder); + builder.Entity().HasData( new UserEntity(1, "johnny", Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "motdepasse", salt: RandomNumberGenerator.GetBytes(128 / 8), @@ -47,7 +47,7 @@ public class StubbedContext : UserDbContext iterationCount: 100000, numBytesRequested: 256 / 8)), "Victor.GABORIT@etu.uca.fr", true)); - modelBuilder.Entity().HasData( + builder.Entity().HasData( new InquiryTableEntity(1, "Inquiry1", "Server=localhost;Database=Inquiry1;Trusted_Connection=True;MultipleActiveResultSets=true"), new InquiryTableEntity(2, "Inquiry2", @@ -55,18 +55,18 @@ public class StubbedContext : UserDbContext new InquiryTableEntity(3, "Inquiry3", "Server=localhost;Database=Inquiry3;Trusted_Connection=True;MultipleActiveResultSets=true")); - modelBuilder.Entity().HasData( + builder.Entity().HasData( new SolutionEntity(1, "Maxime", "Sapountzis", "La cuisine", "Le couteau", "Parce que c'est Maxime"), new SolutionEntity(2, "Johnny", "Ratton", "La cuisine", "Le couteau", "Parce que il est fou"), new SolutionEntity(3, "Erwan", "Menager", "La salle de bain", "L'arachide", "Parce que c'est Erwan")); - modelBuilder.Entity().HasData( + builder.Entity().HasData( new LessonEntity(1, "La cuisine", "Maxime", new DateOnly(2021, 10, 10)), new LessonEntity(2, "La salle de bain", "Erwan", new DateOnly(2021, 10, 10)), new LessonEntity(3, "La chambre", "Johnny", new DateOnly(2021, 10, 10)), new LessonEntity(4, "Le salon", "Clement", new DateOnly(2021, 10, 10))); - modelBuilder.Entity().HasData( + builder.Entity().HasData( new ParagraphEntity(1, "Le premier paragraphe", "Le contenu du premier paragraphe", "Attention", "La query", "Le commentaire", 1), new ParagraphEntity(2, "Le deuxième paragraphe", "Le contenu du deuxième paragraphe", "Attention", @@ -77,7 +77,7 @@ public class StubbedContext : UserDbContext "La query", "Le commentaire", 3), new ParagraphEntity(5, "Le cinquième paragraphe", "Le contenu du quatrième paragraphe", "Attention", "La query", "Le commentaire", 4)); - modelBuilder.Entity().HasData( + builder.Entity().HasData( new InquiryEntity(1, "L'enquête de la carotte", "La description de l'inquiry1", true), new InquiryEntity(2, "L'enquête sur les orang outan", "The new description", false), new InquiryEntity(3, "L'enquête sur les parapluies", "Il pleuvait", false)); diff --git a/API_SQLuedo/TestConsoleAPI/Program.cs b/API_SQLuedo/TestConsoleAPI/Program.cs index 6622ca8..1bea860 100644 --- a/API_SQLuedo/TestConsoleAPI/Program.cs +++ b/API_SQLuedo/TestConsoleAPI/Program.cs @@ -45,7 +45,7 @@ using (var context = new UserDbContext(options)) { Console.WriteLine(); var users = userController.GetUsers(1, 10, UserOrderCriteria.None) as OkObjectResult; - foreach (var item in users.Value as IEnumerable) + foreach (var item in users.Value as IEnumerable) { Console.WriteLine(item); } @@ -55,7 +55,7 @@ using (var context = new UserDbContext(options)) { Console.WriteLine(); var inquiries = inquiryController.GetInquiries(1, 10, InquiryOrderCriteria.None) as OkObjectResult; - foreach (var item in inquiries.Value as IEnumerable) + foreach (var item in inquiries.Value as IEnumerable) { Console.WriteLine(item); } @@ -65,7 +65,7 @@ using (var context = new UserDbContext(options)) { Console.WriteLine(); var paragraphs = paragraphController.GetParagraphs(1, 10, ParagraphOrderCriteria.None) as OkObjectResult; - foreach (var item in paragraphs.Value as IEnumerable) + foreach (var item in paragraphs.Value as IEnumerable) { Console.WriteLine(item); } @@ -75,7 +75,7 @@ using (var context = new UserDbContext(options)) { Console.WriteLine(); var lessons = lessonController.GetLessons(1, 10, LessonOrderCriteria.None) as OkObjectResult; - foreach (var item in lessons.Value as IEnumerable) + foreach (var item in lessons.Value as IEnumerable) { Console.WriteLine(item); } @@ -85,7 +85,7 @@ using (var context = new UserDbContext(options)) { Console.WriteLine(); var successes = successController.GetSuccesses(1, 10, SuccessOrderCriteria.None) as OkObjectResult; - foreach (var item in successes.Value as IEnumerable) + foreach (var item in successes.Value as IEnumerable) { Console.WriteLine(item); } @@ -102,7 +102,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(user.Value as UserDTO); + Console.WriteLine(user.Value as UserDto); } void SearchInquiryByTitle() @@ -116,7 +116,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(inquiry.Value as InquiryDTO); + Console.WriteLine(inquiry.Value as InquiryDto); } void SearchParagraphByTitle() @@ -130,7 +130,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(paragraph.Value as ParagraphDTO); + Console.WriteLine(paragraph.Value as ParagraphDto); } void SearchLessonByTitle() @@ -144,7 +144,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(lesson.Value as LessonDTO); + Console.WriteLine(lesson.Value as LessonDto); } void SearchSuccessByUserId() @@ -158,7 +158,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(success.Value as SuccessDTO); + Console.WriteLine(success.Value as SuccessDto); } void SearchUserById() @@ -172,7 +172,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(user.Value as UserDTO); + Console.WriteLine(user.Value as UserDto); } void SearchInquiryById() @@ -186,7 +186,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(inquiry.Value as InquiryDTO); + Console.WriteLine(inquiry.Value as InquiryDto); } void SearchParagraphById() @@ -200,7 +200,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(paragraph.Value as ParagraphDTO); + Console.WriteLine(paragraph.Value as ParagraphDto); } void SearchSuccessByInquiryId() @@ -214,7 +214,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(success.Value as SuccessDTO); + Console.WriteLine(success.Value as SuccessDto); } void SearchLessonById() @@ -228,7 +228,7 @@ using (var context = new UserDbContext(options)) return; } - Console.WriteLine(lesson.Value as LessonDTO); + Console.WriteLine(lesson.Value as LessonDto); } void AddUser() @@ -239,7 +239,7 @@ using (var context = new UserDbContext(options)) var email = Console.ReadLine(); Console.WriteLine("Veuillez saisir un mot de passe :"); var mdp = Console.ReadLine(); - var res = userController.CreateUser(new UserDTO(username, mdp, email, false)); + var res = userController.CreateUser(new UserDto(username, mdp, email, false)); if (res.GetType() == typeof(CreatedResult)) { Console.WriteLine("\nUtilisateur créé avec succès"); @@ -262,7 +262,7 @@ using (var context = new UserDbContext(options)) var database = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Veuillez saisir l'id de la solution :"); var solution = Convert.ToInt32(Console.ReadLine()); - var res = inquiryController.CreateInquiry(new InquiryDTO(title, description, false)); + var res = inquiryController.CreateInquiry(new InquiryDto(title, description, false)); if (res.GetType() == typeof(CreatedResult)) { Console.WriteLine("\nEnquête créée avec succès"); @@ -287,7 +287,7 @@ using (var context = new UserDbContext(options)) var comment = Console.ReadLine(); Console.WriteLine("Veuillez saisir l'id de la leçon :"); var lesson = Convert.ToInt32(Console.ReadLine()); - var res = paragraphController.CreateParagraph(new ParagraphDTO(title, content, info, query, comment, lesson)); + var res = paragraphController.CreateParagraph(new ParagraphDto(title, content, info, query, comment, lesson)); if (res.GetType() == typeof(CreatedResult)) { Console.WriteLine("\nParagraphe créé avec succès"); @@ -305,7 +305,7 @@ using (var context = new UserDbContext(options)) Console.WriteLine("Veuillez saisir votre nom :"); var lastPublisher = Console.ReadLine(); var res = lessonController.CreateLesson( - new LessonDTO(title, lastPublisher, DateOnly.FromDateTime(DateTime.Now))); + new LessonDto(title, lastPublisher, DateOnly.FromDateTime(DateTime.Now))); if (res.GetType() == typeof(CreatedResult)) { Console.WriteLine("\nLeçon créée avec succès"); @@ -324,7 +324,7 @@ using (var context = new UserDbContext(options)) var inquiryId = Console.ReadLine(); Console.WriteLine("Veuillez indiquer si l'enquête a été complété (true/false) :"); var isFinished = Console.ReadLine(); - var res = successController.CreateSuccess(new SuccessDTO(int.Parse(userId), int.Parse(inquiryId), + var res = successController.CreateSuccess(new SuccessDto(int.Parse(userId), int.Parse(inquiryId), bool.Parse(isFinished))); if (res.GetType() == typeof(CreatedResult)) { @@ -343,7 +343,7 @@ using (var context = new UserDbContext(options)) var res = (userController.GetUserById(id)); if (res.GetType() == typeof(OkObjectResult)) { - var user = (res as OkObjectResult).Value as UserDTO; + var user = (res as OkObjectResult).Value as UserDto; if (user == null) { Console.WriteLine("Erreur, un problème est survenu"); @@ -357,7 +357,7 @@ using (var context = new UserDbContext(options)) Console.WriteLine("Veuillez saisir l'email :"); var email = Console.ReadLine(); var retour = - userController.UpdateUser(id, new UserDTO(id, username, user.Password, email, user.IsAdmin)); + userController.UpdateUser(id, new UserDto(id, username, user.Password, email, user.IsAdmin)); if (retour.GetType() == typeof(OkObjectResult)) { Console.WriteLine("Mise à jour effectué avec succès !"); @@ -381,7 +381,7 @@ using (var context = new UserDbContext(options)) var res = (inquiryController.GetInquiryById(id)); if (res.GetType() == typeof(OkObjectResult)) { - var user = (res as OkObjectResult).Value as InquiryDTO; + var user = (res as OkObjectResult).Value as InquiryDto; if (user == null) { Console.WriteLine("Erreur, un problème est survenu"); @@ -401,7 +401,7 @@ using (var context = new UserDbContext(options)) Console.WriteLine("Veuillez saisir un commentaire :"); var inquiryTable = Convert.ToInt32(Console.ReadLine()); var retour = - inquiryController.UpdateInquiry(id, new InquiryDTO(id, title, description, bool.Parse(isUser))); + inquiryController.UpdateInquiry(id, new InquiryDto(id, title, description, bool.Parse(isUser))); if (retour.GetType() == typeof(OkObjectResult)) { Console.WriteLine("Mise à jour effectué avec succès !"); @@ -425,7 +425,7 @@ using (var context = new UserDbContext(options)) var res = (paragraphController.GetParagraphById(id)); if (res.GetType() == typeof(OkObjectResult)) { - var paragraph = (res as OkObjectResult).Value as ParagraphDTO; + var paragraph = (res as OkObjectResult).Value as ParagraphDto; if (paragraph == null) { Console.WriteLine("Erreur, un problème est survenu"); @@ -447,7 +447,7 @@ using (var context = new UserDbContext(options)) Console.WriteLine("Veuillez saisir l'id de la leçon :"); var lesson = Convert.ToInt32(Console.ReadLine()); var retour = paragraphController.UpdateParagraph(id, - new ParagraphDTO(id, title, content, info, query, comment, lesson)); + new ParagraphDto(id, title, content, info, query, comment, lesson)); if (retour.GetType() == typeof(OkObjectResult)) { Console.WriteLine("Mise à jour effectué avec succès !"); @@ -471,7 +471,7 @@ using (var context = new UserDbContext(options)) var res = (lessonController.GetLessonById(id)); if (res.GetType() == typeof(OkObjectResult)) { - var lesson = (res as OkObjectResult).Value as LessonDTO; + var lesson = (res as OkObjectResult).Value as LessonDto; if (lesson == null) { Console.WriteLine("Erreur, un problème est survenu"); @@ -485,7 +485,7 @@ using (var context = new UserDbContext(options)) Console.WriteLine("Veuillez saisir votre nom :"); var lastPublisher = Console.ReadLine(); var retour = lessonController.UpdateLesson(id, - new LessonDTO(id, title, lastPublisher, DateOnly.FromDateTime(DateTime.Now))); + new LessonDto(id, title, lastPublisher, DateOnly.FromDateTime(DateTime.Now))); if (retour.GetType() == typeof(OkObjectResult)) { Console.WriteLine("Mise à jour effectué avec succès !"); @@ -509,7 +509,7 @@ using (var context = new UserDbContext(options)) var res = (successController.GetSuccessByUserId(id)); if (res.GetType() == typeof(OkObjectResult)) { - var lesson = (res as OkObjectResult).Value as SuccessDTO; + var lesson = (res as OkObjectResult).Value as SuccessDto; if (lesson == null) { Console.WriteLine("Erreur, un problème est survenu"); @@ -525,7 +525,7 @@ using (var context = new UserDbContext(options)) Console.WriteLine("Veuillez saisir si l'enquête est terminée (0/1) :"); var isFinished = Console.ReadLine(); var retour = successController.UpdateSuccess(userId, inquiryId, - new SuccessDTO(userId, inquiryId, bool.Parse(isFinished))); + new SuccessDto(userId, inquiryId, bool.Parse(isFinished))); if (retour.GetType() == typeof(OkObjectResult)) { Console.WriteLine("Mise à jour effectué avec succès !"); @@ -780,7 +780,7 @@ using (var context = new UserDbContext(options)) } else { - var users = res as IEnumerable; + var users = res as IEnumerable; if (users == null) { Console.WriteLine("\nErreur, les ustilisateurs n'ont pas été trouvés !"); @@ -836,7 +836,7 @@ using (var context = new UserDbContext(options)) // Ajout d'un utilisateur Console.WriteLine("\n##########################################################\n"); Console.WriteLine("Création de l'utilisateur :\n"); - var user2 = new UserDTO("JohnDoe", "motdepasse", "johndoe@gmail.com", false); + var user2 = new UserDto("JohnDoe", "motdepasse", "johndoe@gmail.com", false); Console.WriteLine(user2); var res3 = userController.CreateUser(user2); if (res3 == null) @@ -863,7 +863,7 @@ using (var context = new UserDbContext(options)) { Console.WriteLine(user2); Console.WriteLine("\nNouvelle adresse : John.DOE@etu.uca.fr"); - var user3 = new UserDTO(user2.Id, user2.Username, user2.Password, "John.DOE@etu.uca.fr", user2.IsAdmin); + var user3 = new UserDto(user2.Id, user2.Username, user2.Password, "John.DOE@etu.uca.fr", user2.IsAdmin); var res4 = userController.UpdateUser(1, user3); if (res4 == null) {