You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Verax_API_EF/Verax_API_EF/API_Mapping/ArticleMapper.cs

27 lines
620 B

using Model;
using Web_API.Model;
namespace API_Mapping;
public static class ArticleMapper
{
public static ArticleDTO ToDTO(this Article? a) => new()
{
Id = a.Id,
Title = a.Title,
Description = a.Description,
DatePublished = a.DatePublished,
LectureTime = a.LectureTime,
Author = a.Author
};
public static Article ToModel(this ArticleDTO a) => new()
{
Id = a.Id,
Title = a.Title,
Description = a.Description,
DatePublished = a.DatePublished,
LectureTime = a.LectureTime,
Author = a.Author
};
}