コード例 #1
0
        public List <DinoModel> GetDinosaurs()
        {
            var DinosaurList     = new List <DinoModel>();
            var TyrannosaurusRex = new DinoModel {
                ID       = 1,
                Name     = "Tyrannosaurus Rex",
                ImageURL = "http://www.sciencekids.co.nz/images/pictures/dinosaurs/tyrannosaurusrex/trexroar.jpg",
                Length   = "42 feet",
                Weight   = "7 tons",
                Habitat  = "Temperate Coniferous Forest"
            };
            var Velociraptor = new DinoModel {
                ID       = 2,
                Name     = "Velociraptor",
                ImageURL = "http://www.sciencekids.co.nz/images/pictures/dinosaurs/velociraptor.jpg",
                Length   = "6 feet",
                Weight   = "33 lbs",
                Habitat  = "Desert"
            };
            var Triceratops = new DinoModel {
                ID       = 3,
                Name     = "Triceratops",
                ImageURL = "http://www.sciencekids.co.nz/images/pictures/dinosaurs/triceratops/triceratopsfacesketch.JPG",
                Length   = "26 feet",
                Weight   = "12 tons",
                Habitat  = "Temperate Coniferous Forest"
            };
            var Brachiosaurus = new DinoModel {
                ID       = 4,
                Name     = "Brachiosaurus",
                ImageURL = "http://www.sciencekids.co.nz/images/pictures/dinosaurs/brachiosaurusdrawing.jpg",
                Length   = "85 feet",
                Weight   = "50 tons",
                Habitat  = "Temperate Deciduous Forest"
            };
            var Stegosaurus = new DinoModel {
                ID       = 5,
                Name     = "Stegosaurus",
                ImageURL = "http://www.sciencekids.co.nz/images/pictures/dinosaurs/stegosaurus/stegosaurusillustration.jpg",
                Length   = "30 feet",
                Weight   = "5 tons",
                Habitat  = "Grassland"
            };
            var Iguanodon = new DinoModel {
                ID       = 6,
                Name     = "Iguanodon",
                ImageURL = "http://www.sciencekids.co.nz/images/experiments/iguanodon170.jpg",
                Length   = "33 feet",
                Weight   = "3.5 tons",
                Habitat  = "Temperate Deciduous Forest"
            };

            DinosaurList.Add(TyrannosaurusRex);
            DinosaurList.Add(Velociraptor);
            DinosaurList.Add(Triceratops);
            DinosaurList.Add(Brachiosaurus);
            DinosaurList.Add(Stegosaurus);
            DinosaurList.Add(Iguanodon);
            return(DinosaurList);
        }
コード例 #2
0
ファイル: DinoModel.cs プロジェクト: Yana727/DinoAPI
        public List <DinoModel> DinoListGetter()
        {
            var DinoList    = new List <DinoModel>();
            var Alamosaurus = new DinoModel
            {
                id      = 1,
                name    = "Alamosaurus",
                size    = "98 ft",
                weight  = "73 tonnes",
                habitat =
                    "Skeletal elements of Alamosaurus are among the most common Late Cretaceous dinosaur fossils found in the United States Southwest and are now used to define the fauna of that time and place, known as the Alamosaurus fauna."
            };
            var Albertaceratops = new DinoModel
            {
                id      = 2,
                name    = "Albertaceratops",
                size    = "19 ft",
                weight  = "7,700 lb",
                habitat = "North America"
            };
            var Anchiceratops = new DinoModel
            {
                id      = 3,
                name    = "Anchiceratops",
                size    = "16.4 ft",
                weight  = "1.2 tonnes",
                habitat =
                    "Most Anchiceratops fossils have been discovered in the Horseshoe Canyon Formation of Alberta, which belongs to the later part of the Campanian stage of the Late Cretaceous Period (Anchiceratops remains are known from the lower part of the formation, and range in age between 72.5-71 million years ago)"
            };
            var Ankylosaurus = new DinoModel
            {
                id      = 4,
                name    = "Ankylosaurus",
                size    = "20.5 feet",
                weight  = "13,000 lb",
                habitat = "Canada"
            };
            var Barney = new DinoModel
            {
                id   = 5,
                name = "Barney",

                size    = "6 ft",
                weight  = "150 lb",
                habitat = "Hollywood, CA"
            };

            DinoList.Add(Alamosaurus);
            DinoList.Add(Albertaceratops);
            DinoList.Add(Anchiceratops);
            DinoList.Add(Ankylosaurus);
            DinoList.Add(Barney);
            return(DinoList);
        }