コード例 #1
0
        internal DogSearchResultsListBuilder ListOf14Beagels()
        {
            var category = new Category() { Description = "Dogs for hunting foxes and badgers etc.", Id = 3, Name = "Hunting" };
            var beagle = new Breed() { Name = "Beagel", Category = category, Id = 3, Species = null };

            var beagleHuntingDog = new Dog() { Name = "Shep", Breed = beagle };
            var fourteenMatchedDogs = new ObservableCollection<Dog>()
            {   beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
                ,beagleHuntingDog
            };
            _dogs.AddRange(fourteenMatchedDogs);
            return this;
        }
コード例 #2
0
        internal DogSearchResultsListBuilder ListOf3DalmatiansByCategory(int categoryId, int breedId)
        {
            var category = new Category() { Description = "Dogs for hunting foxes and badgers etc.", Id = categoryId, Name = "Hunting" };
            var dalmatian = new Breed() { Name = "Dalmatian", Category = category, Id = breedId, Species = null };

            var dalmatianDog1 = new Dog() { Name = "Tip", Breed = dalmatian, BreedId = breedId};
            var dalmatianDog2 = new Dog() { Name = "Snoop", Breed = dalmatian, BreedId = breedId };
            var dalmatianDog3 = new Dog() { Name = "Ron", Breed = dalmatian, BreedId = breedId };

            var matchedDogs = new ObservableCollection<Dog>()
            {   dalmatianDog1
                ,dalmatianDog2
                ,dalmatianDog3
            };
            _dogs.AddRange(matchedDogs);
            return this;
        }
コード例 #3
0
        internal DogSearchResultsListBuilder ListOf3BeagelsByCategory(int categoryId, int breedId)
        {
            var category = new Category() { Description = "Dogs for hunting foxes and badgers etc.", Id = categoryId, Name = "Hunting" };
            var beagle = new Breed() { Name = "Beagel", Category = category, Id = breedId, Species = null };

            var beagleHuntingDog1 = new Dog() { Name = "Shep", Breed = beagle };
            var beagleHuntingDog2 = new Dog() { Name = "Flo", Breed = beagle };
            var beagleHuntingDog3 = new Dog() { Name = "Rex", Breed = beagle };

            var matchedDogs = new ObservableCollection<Dog>()
            {   beagleHuntingDog1
                ,beagleHuntingDog2
                ,beagleHuntingDog3
            };
            _dogs.AddRange(matchedDogs);
            return this;
        }