示例#1
0
 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
     });
 }
示例#2
0
        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);
        }