Ejemplo n.º 1
0
        public static GenusDto Build(Genus genus)
        {
            var speciesList = new List<SpeciesDto>();

            if (genus.Species != null)
            {
                genus.Species.ToList().ForEach(s => speciesList.Add(Build(s)));
            }

            return new GenusDto { Id = genus.Id, Name = genus.Name, Species = speciesList };
        }
Ejemplo n.º 2
0
        public GenusDto Build(Genus genus)
        {
            var speciesList = new List<SpeciesDto>();

            genus.Species.ToList().ForEach(s => speciesList.Add(this.Build(s)));

            return new GenusDto
                       {
                           Id = genus.Id,
                           Name = genus.Name,
                           Species = speciesList
                       };
        }
Ejemplo n.º 3
0
        public Species Build(Infrastructure.Data.Species dataSpecies, Genus genus, bool hasPhotos)
        {
            var hasFish = dataSpecies.Fish.Count > 0;

            var species = new Species(dataSpecies.SpeciesID)
                              {
                                  Genus = genus,
                                  Described = Convert.ToBoolean(dataSpecies.Described),
                                  Name = dataSpecies.SpeciesName.Trim(),
                                  HaveFish = hasFish,
                                  HasPhotos = hasPhotos
                              };

            return species;
        }