diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/BlackListEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/BlackListEntity.cs similarity index 94% rename from API_SQLuedo/EntityFramework/SQLudeoDB/BlackListEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/BlackListEntity.cs index 0bd485b..a1cb718 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/BlackListEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/BlackListEntity.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class BlackListEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/ContentLessonEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/ContentLessonEntity.cs similarity index 90% rename from API_SQLuedo/EntityFramework/SQLudeoDB/ContentLessonEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/ContentLessonEntity.cs index f701557..d352c7b 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/ContentLessonEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/ContentLessonEntity.cs @@ -5,8 +5,9 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; +using Entities.SQLuedoDB; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class ContentLessonEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/InquiryEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/InquiryEntity.cs similarity index 97% rename from API_SQLuedo/EntityFramework/SQLudeoDB/InquiryEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/InquiryEntity.cs index 48b9edd..ed15696 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/InquiryEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/InquiryEntity.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class InquiryEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/InquiryTableEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/InquiryTableEntity.cs similarity index 97% rename from API_SQLuedo/EntityFramework/SQLudeoDB/InquiryTableEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/InquiryTableEntity.cs index 6236273..d9ee75f 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/InquiryTableEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/InquiryTableEntity.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class InquiryTableEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/LessonEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/LessonEntity.cs similarity index 96% rename from API_SQLuedo/EntityFramework/SQLudeoDB/LessonEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/LessonEntity.cs index bd869f3..1f3bff3 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/LessonEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/LessonEntity.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class LessonEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/NotepadEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/NotepadEntity.cs similarity index 97% rename from API_SQLuedo/EntityFramework/SQLudeoDB/NotepadEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/NotepadEntity.cs index a68e91d..f20c498 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/NotepadEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/NotepadEntity.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class NotepadEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/ParagraphEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/ParagraphEntity.cs similarity index 96% rename from API_SQLuedo/EntityFramework/SQLudeoDB/ParagraphEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/ParagraphEntity.cs index aefcc9d..996dc88 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/ParagraphEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/ParagraphEntity.cs @@ -1,4 +1,4 @@ -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class ParagraphEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/SolutionEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/SolutionEntity.cs similarity index 98% rename from API_SQLuedo/EntityFramework/SQLudeoDB/SolutionEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/SolutionEntity.cs index db727a0..f7df58e 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/SolutionEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/SolutionEntity.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.Security.Cryptography.X509Certificates; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class SolutionEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/SuccessEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/SuccessEntity.cs similarity index 97% rename from API_SQLuedo/EntityFramework/SQLudeoDB/SuccessEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/SuccessEntity.cs index 780fdd4..498286a 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/SuccessEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/SuccessEntity.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { public class SuccessEntity { diff --git a/API_SQLuedo/EntityFramework/SQLudeoDB/UserEntity.cs b/API_SQLuedo/EntityFramework/SQLuedoDB/UserEntity.cs similarity index 96% rename from API_SQLuedo/EntityFramework/SQLudeoDB/UserEntity.cs rename to API_SQLuedo/EntityFramework/SQLuedoDB/UserEntity.cs index 4829445..82f168b 100644 --- a/API_SQLuedo/EntityFramework/SQLudeoDB/UserEntity.cs +++ b/API_SQLuedo/EntityFramework/SQLuedoDB/UserEntity.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace Entities.SQLudeoDB +namespace Entities.SQLuedoDB { [Table("user")] public class UserEntity diff --git a/API_SQLuedo/Model/Business/BlackList.cs b/API_SQLuedo/Model/Business/BlackList.cs new file mode 100644 index 0000000..b7fb84b --- /dev/null +++ b/API_SQLuedo/Model/Business/BlackList.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model.Business +{ + public class BlackList + { + public string Email { get; set; } + public DateOnly ExpirationDate { get; set; } + + public BlackList(string email, DateOnly expirationDate) + { + Email = email; + ExpirationDate = expirationDate; + } + } +} diff --git a/API_SQLuedo/Model/Business/Lesson.cs b/API_SQLuedo/Model/Business/Lesson.cs new file mode 100644 index 0000000..de2d9a0 --- /dev/null +++ b/API_SQLuedo/Model/Business/Lesson.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model.Business +{ + public class Lesson + { + public int Id { get; } + public string Title { get; set; } + public string LastPublisher { get; set; } + public DateOnly LastEdit { get; set; } + + public Lesson() { } + public Lesson(int id, string title, string lastPublisher, DateOnly lastEdit) + { + Id = id; + Title = title; + LastPublisher = lastPublisher; + LastEdit = lastEdit; + } + + public Lesson(string title, string lastPublisher, DateOnly lastEdit) + { + Title = title; + LastPublisher = lastPublisher; + LastEdit = lastEdit; + } + } +} diff --git a/API_SQLuedo/Model/Business/Paragraph.cs b/API_SQLuedo/Model/Business/Paragraph.cs new file mode 100644 index 0000000..f33b5bc --- /dev/null +++ b/API_SQLuedo/Model/Business/Paragraph.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model.Business +{ + public class Paragraph + { + public int Id { get; } + public string Title { get; set; } + public string Content { get; set; } + public string Info { get; set; } + public string Query { get; set; } + public string Comment { get; set; } + + public Paragraph() { } + + public Paragraph(int id, string title, string content, string info, string query, string comment) + { + Id = id; + Title = title; + Content = content; + Info = info; + Query = query; + Comment = comment; + } + public Paragraph(string title, string content, string info, string query, string comment) + { + Title = title; + Content = content; + Info = info; + Query = query; + Comment = comment; + } + } +} diff --git a/API_SQLuedo/Model/DTO/BlackListDTO.cs b/API_SQLuedo/Model/DTO/BlackListDTO.cs new file mode 100644 index 0000000..2ecfcaf --- /dev/null +++ b/API_SQLuedo/Model/DTO/BlackListDTO.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model.DTO +{ + public class BlackListDTO + { + public string Email { get; set; } + public DateOnly ExpirationDate { get; set; } + + public BlackListDTO(string email, DateOnly expirationDate) + { + Email = email; + ExpirationDate = expirationDate; + } + } +} diff --git a/API_SQLuedo/Model/DTO/LessonDTO.cs b/API_SQLuedo/Model/DTO/LessonDTO.cs new file mode 100644 index 0000000..dfc3351 --- /dev/null +++ b/API_SQLuedo/Model/DTO/LessonDTO.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model.DTO +{ + public class LessonDTO + { + public int Id { get; } + public string Title { get; set; } + public string LastPublisher { get; set; } + public DateOnly LastEdit { get; set; } + + public LessonDTO() { } + public LessonDTO(int id, string title, string lastPublisher, DateOnly lastEdit) + { + Id = id; + Title = title; + LastPublisher = lastPublisher; + LastEdit = lastEdit; + } + + public LessonDTO(string title, string lastPublisher, DateOnly lastEdit) + { + Title = title; + LastPublisher = lastPublisher; + LastEdit = lastEdit; + } + } +} diff --git a/API_SQLuedo/Model/DTO/ParagraphDTO.cs b/API_SQLuedo/Model/DTO/ParagraphDTO.cs new file mode 100644 index 0000000..e6a3442 --- /dev/null +++ b/API_SQLuedo/Model/DTO/ParagraphDTO.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model.DTO +{ + public class ParagraphDTO + { + public int Id { get; } + public string Title { get; set; } + public string Content { get; set; } + public string Info { get; set; } + public string Query { get; set; } + public string Comment { get; set; } + + public ParagraphDTO() { } + + public ParagraphDTO(int id, string title, string content, string info, string query, string comment) + { + Id = id; + Title = title; + Content = content; + Info = info; + Query = query; + Comment = comment; + } + public ParagraphDTO(string title, string content, string info, string query, string comment) + { + Title = title; + Content = content; + Info = info; + Query = query; + Comment = comment; + } + } +} diff --git a/API_SQLuedo/Model/Mappers/BlackListMapper.cs b/API_SQLuedo/Model/Mappers/BlackListMapper.cs new file mode 100644 index 0000000..dc9a5fa --- /dev/null +++ b/API_SQLuedo/Model/Mappers/BlackListMapper.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Entities.SQLudeoDB; +using Model.Business; +using Model.DTO; + +namespace Model.Mappers +{ + public class BlackListMapper + { + public static BlackListDTO FromModelToDTO(BlackList model) + { + return new BlackListDTO(model.Email, model.ExpirationDate); + } + + public static BlackListDTO FromEntityToDTO(BlackListEntity ent) + { + return new BlackListDTO(ent.Email, ent.ExpirationDate); + } + + public static BlackList FromDTOToModel(BlackListDTO dto) + { + return new BlackList(dto.Email, dto.ExpirationDate); + } + + public static BlackList FromEntityToModel(BlackListEntity ent) + { + return new BlackList(ent.Email, ent.ExpirationDate); + } + + public static BlackListEntity FromDTOToEntity(BlackListDTO dto) + { + return new BlackListEntity(dto.Email, dto.ExpirationDate); + } + + public static BlackListEntity FromModelToEntity(BlackList model) + { + return new BlackListEntity(model.Email, model.ExpirationDate); + } + } +} diff --git a/API_SQLuedo/Model/Mappers/LessonMapper.cs b/API_SQLuedo/Model/Mappers/LessonMapper.cs new file mode 100644 index 0000000..2463006 --- /dev/null +++ b/API_SQLuedo/Model/Mappers/LessonMapper.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Entities.SQLudeoDB; +using Model.Business; +using Model.DTO; + +namespace Model.Mappers +{ + public class LessonMapper + { + + public static LessonDTO FromModelToDTO(Lesson model) + { + return new LessonDTO(model.Id, model.Title, model.LastPublisher, model.LastEdit); + } + + public static LessonDTO FromEntityToDTO(LessonEntity model) + { + return new LessonDTO(model.Id, model.Title, model.LastPublisher, model.LastEdit); + } + + public static LessonEntity FromModelToEntity(Lesson model) + { + return new LessonEntity(model.Id, model.Title, model.LastPublisher, model.LastEdit); + } + + public static LessonEntity FromDTOToEntity(LessonDTO dto) + { + return new LessonEntity(dto.Id, dto.Title, dto.LastPublisher, dto.LastEdit); + } + + public static Lesson FromDTOToModel(LessonDTO dto) + { + return new Lesson(dto.Id, dto.Title, dto.LastPublisher, dto.LastEdit); + } + + public static Lesson FromEntityToModel(LessonEntity entity) + { + return new Lesson(entity.Id, entity.Title, entity.LastPublisher, entity.LastEdit); + } + } +} diff --git a/API_SQLuedo/Model/Mappers/ParagraphMapper.cs b/API_SQLuedo/Model/Mappers/ParagraphMapper.cs new file mode 100644 index 0000000..722184c --- /dev/null +++ b/API_SQLuedo/Model/Mappers/ParagraphMapper.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model.Mappers +{ + internal class ParagraphMapper + { + } +}