From 1ec49061a91a684671ca2a71f23c538d476abfef Mon Sep 17 00:00:00 2001 From: Erwan MENAGER Date: Mon, 11 Mar 2024 23:59:41 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20du=20merge=20!=20(Impl=C3=A9mentation=20e?= =?UTF-8?q?n=20cours=20des=20derniers=20services=20et=20adaptation=20des?= =?UTF-8?q?=20m=C3=A9thodes=20CRUD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Controllers/InquiriesController.cs | 2 +- API_SQLuedo/API/Service/LessonDataServiceAPI.cs | 7 +------ API_SQLuedo/Shared/ILessonDataService.cs | 13 +++++++------ API_SQLuedo/Shared/ILessonService.cs | 16 ++++++++-------- API_SQLuedo/Shared/ParagraphDataService.cs | 1 + 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/API_SQLuedo/API/Controllers/InquiriesController.cs b/API_SQLuedo/API/Controllers/InquiriesController.cs index f78a8e6..7bb0955 100644 --- a/API_SQLuedo/API/Controllers/InquiriesController.cs +++ b/API_SQLuedo/API/Controllers/InquiriesController.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Dto; using Model.OrderCriteria; -using Services; +using Shared; using Asp.Versioning; namespace API.Controllers diff --git a/API_SQLuedo/API/Service/LessonDataServiceAPI.cs b/API_SQLuedo/API/Service/LessonDataServiceAPI.cs index 50d864b..6707cf1 100644 --- a/API_SQLuedo/API/Service/LessonDataServiceAPI.cs +++ b/API_SQLuedo/API/Service/LessonDataServiceAPI.cs @@ -4,7 +4,7 @@ using Shared; namespace API.Service; -public class LessonDataServiceApi(ILessonService lessonService) : ILessonDataService +public class LessonDataServiceApi(ILessonService lessonService) : ILessonService { public IEnumerable GetLessons(int page, int number) { @@ -23,9 +23,4 @@ public class LessonDataServiceApi(ILessonService lessonService) : public LessonEntity CreateLesson(string title, string lastPublisher, DateOnly? lastEdit) => lessonService.CreateLesson(title, lastPublisher, lastEdit); - - public IEnumerable GetLessons(int page, int number, LessonOrderCriteria orderCriteria) - { - throw new NotImplementedException(); - } } \ No newline at end of file diff --git a/API_SQLuedo/Shared/ILessonDataService.cs b/API_SQLuedo/Shared/ILessonDataService.cs index b3bdb83..3a9fad4 100644 --- a/API_SQLuedo/Shared/ILessonDataService.cs +++ b/API_SQLuedo/Shared/ILessonDataService.cs @@ -1,14 +1,15 @@ +using Dto; using Model.OrderCriteria; namespace Shared; -public interface ILessonDataService +public interface ILessonDataService : IDataService { - public IEnumerable GetLessons(int page, int number, LessonOrderCriteria orderCriteria); - public TLesson GetLessonById(int id); - public TLesson GetLessonByTitle(string title); + public IEnumerable GetLessons(int page, int number, LessonOrderCriteria orderCriteria); + public LessonDTO GetLessonById(int id); + public LessonDTO GetLessonByTitle(string title); public bool DeleteLesson(int id); - public TLesson UpdateLesson(int id, TLesson lesson); - public TLesson CreateLesson(string title, string lastPublisher, DateOnly? lastEdit); + public LessonDTO UpdateLesson(int id, LessonDTO lesson); + public LessonDTO CreateLesson(string title, string lastPublisher, DateOnly? lastEdit); } \ No newline at end of file diff --git a/API_SQLuedo/Shared/ILessonService.cs b/API_SQLuedo/Shared/ILessonService.cs index dd66837..9474430 100644 --- a/API_SQLuedo/Shared/ILessonService.cs +++ b/API_SQLuedo/Shared/ILessonService.cs @@ -1,11 +1,11 @@ -namespace Shared; - -public interface ILessonService -{ - public IEnumerable GetLessons(int page, int number); - public TLesson GetLessonById(int id); - public TLesson GetLessonByTitle(string title); +namespace Shared; + +public interface ILessonService +{ + public IEnumerable GetLessons(int page, int number); + public TLesson GetLessonById(int id); + public TLesson GetLessonByTitle(string title); public bool DeleteLesson(int id); public TLesson UpdateLesson(int id, TLesson lesson); - public TLesson CreateLesson(string title, string lastPublisher, DateOnly? lastEdit); + public TLesson CreateLesson(string title, string lastPublisher, DateOnly? lastEdit); } \ No newline at end of file diff --git a/API_SQLuedo/Shared/ParagraphDataService.cs b/API_SQLuedo/Shared/ParagraphDataService.cs index 7d4f3ae..4757dad 100644 --- a/API_SQLuedo/Shared/ParagraphDataService.cs +++ b/API_SQLuedo/Shared/ParagraphDataService.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore; using Dto; using DbContextLib; using Model.OrderCriteria; +using Shared; using Shared.Mapper; namespace Services;