public static PetDto From([NotNull] IPet pet) { return(new PetDto { Id = pet.Id, Name = pet.Name, Morph = pet.Morph, HatchDate = pet.HatchDate, Species = (pet.Species != null) ? SpeciesDto.From(pet.Species) : null, CareTakerId = pet.CareTaker.Guid, LatestSample = (pet.LatestSample != null) ? SampleDto.From(pet.LatestSample) : null }); }
public static SampleDto From([NotNull] IEnvDataSample sample) { var dto = new SampleDto { Environment = sample.Environment?.Id, Occupant = sample.Occupant?.Id, Captured = sample.Captured ?? DateTime.MinValue, HotGlass = sample.HotGlass, HotMat = sample.HotMat, MidGlass = sample.MidGlass, ColdGlass = sample.ColdGlass, ColdMat = sample.ColdMat }; return(dto); }