initial commit

This commit is contained in:
Julian
2022-01-23 19:20:13 +01:00
parent d4508520d4
commit 0e1b585db6
25 changed files with 758 additions and 0 deletions

30
Converters/Extensions.cs Normal file
View File

@@ -0,0 +1,30 @@
using System.Linq;
using weddingapi.Dtos;
using weddingapi.Models;
namespace weddingapi.Converters
{
public static class Converters
{
public static FamilyDto AsDto(this Family family)
{
return new FamilyDto()
{
Id = family.Id,
CreatedDate = family.CreatedDate,
Members = family.Members.Select(person => person.AsDto()).ToList(),
Name = family.Name,
};
}
public static PersonDto AsDto(this Person person)
{
return new PersonDto()
{
IsChild = person.IsChild,
Name = person.Name,
};
}
}
}