Refactoring, database structure changed
This commit is contained in:
21
WatchIt.DTO/Models/Controllers/Genres/GenresMappers.cs
Normal file
21
WatchIt.DTO/Models/Controllers/Genres/GenresMappers.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using WatchIt.DTO.Models.Controllers.Genres.Genre;
|
||||
|
||||
namespace WatchIt.DTO.Models.Controllers.Genres;
|
||||
|
||||
public static class GenresMappers
|
||||
{
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public static GenreResponse ToResponse(this Database.Model.Genres.Genre entity) => new GenreResponse
|
||||
{
|
||||
Id = entity.Id,
|
||||
Name = entity.Name,
|
||||
};
|
||||
|
||||
public static Database.Model.Genres.Genre ToEntity(this GenreRequest request) => new Database.Model.Genres.Genre
|
||||
{
|
||||
Name = request.Name,
|
||||
};
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user