Changement du namespace + Ajout Mapper et ce qui va pour Lesson,BlackList et début Paragraph

pull/26/head
Maxime SAPOUNTZIS 1 year ago
parent 942b14631d
commit 9a7c101351

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

@ -5,8 +5,9 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Entities.SQLuedoDB;
namespace Entities.SQLudeoDB namespace Entities.SQLuedoDB
{ {
public class ContentLessonEntity public class ContentLessonEntity
{ {

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Entities.SQLudeoDB namespace Entities.SQLuedoDB
{ {
public class InquiryEntity public class InquiryEntity
{ {

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Entities.SQLudeoDB namespace Entities.SQLuedoDB
{ {
public class InquiryTableEntity public class InquiryTableEntity
{ {

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Entities.SQLudeoDB namespace Entities.SQLuedoDB
{ {
public class LessonEntity public class LessonEntity
{ {

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

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

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

@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Entities.SQLudeoDB namespace Entities.SQLuedoDB
{ {
public class SuccessEntity public class SuccessEntity
{ {

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

@ -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;
}
}
}

@ -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;
}
}
}

@ -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;
}
}
}

@ -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;
}
}
}

@ -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;
}
}
}

@ -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;
}
}
}

@ -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);
}
}
}

@ -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);
}
}
}

@ -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
{
}
}
Loading…
Cancel
Save