Introduce dtos

This commit is contained in:
2023-10-16 22:37:49 +02:00
parent 707bfae2e3
commit fc98f99eda
9 changed files with 107 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
using GerbilManager.Dtos;
using GerbilManager.Models;
namespace GerbilManager.Converter
{
public static class GerbilConverterExtension
{
public static GerbilDto AsDto(this Gerbil gerbil)
{
return new GerbilDto{
Breeder = gerbil.Breeder.AsDto(),
Gender = (GenderDto) ((int) gerbil.Gender),
Name = gerbil.Name,
Litter = gerbil.Litter.AsDto()
};
}
}
}