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.
Dotnet-WebAPI/API/DTO/ModelToDto.cs

16 lines
434 B

using Model;
namespace API.DTO;
public static class ModelToDto
{
public static TacticDto ToDto(this Tactic t)
{
return new TacticDto(t.Id, t.Name, t.OwnerId, t.CourtType.ToString().ToUpper(), new DateTimeOffset(t.CreationDate).ToUnixTimeMilliseconds());
}
public static TacticStepDto ToDto(this TacticStep t)
{
return new TacticStepDto(t.Id, t.Parent, t.Children.Select(s => s.ToDto()));
}
}