Example #1
0
        private static void Initialize()
        {
            if (!_isInitialized)
            {
                var shelter = new Shelter.Shared.Shelter()
                {
                    ShelterId = 1,
                    Name      = "Our shelter"
                };

                shelter.Animals = new List <Animal>
                {
                    new Cat {
                        Id = 1, Name = "Poes", DateOfBirth = new DateTime(2000, 02, 14), IsChecked = true, KidFriendly = false, Since = DateTime.Now, Declawed = true, Race = "Hairless Sphynx"
                    },
                    new Cat {
                        Id = 2, Name = "Kity", DateOfBirth = new DateTime(2000, 02, 14), IsChecked = true, KidFriendly = false, Since = DateTime.Now, Declawed = true, Race = "Hairless Sphynx"
                    },
                    new Cat {
                        Id = 3, Name = "wietel", DateOfBirth = new DateTime(2000, 02, 14), IsChecked = true, KidFriendly = false, Since = DateTime.Now, Declawed = true, Race = "Hairless Sphynx"
                    },
                    new Dog {
                        Id = 4, Name = "Felix", DateOfBirth = new DateTime(2000, 02, 14), IsChecked = true, KidFriendly = true, Since = DateTime.Now, Barker = true, Race = "Golden Retriever"
                    },
                    new Dog {
                        Id = 5, Name = "peppa", DateOfBirth = new DateTime(2000, 02, 14), IsChecked = true, KidFriendly = true, Since = DateTime.Now, Barker = true, Race = "Danish Dog"
                    },
                };


                _shelter       = shelter;
                _isInitialized = true;
            }
        }
Example #2
0
        private static void Initialize()
        {
            if (!_isInitialized)
            {
                var shelter = new Shelter.Shared.Shelter()
                {
                    Animals = new List <Animal> {
                        // (int id, string name, string race, DateTime dateOfBirth, bool isChecked, bool kidFriendly, DateTime since, int shelterId, bool barker)
                        new Dog(1, "Sia", "Shitzu", new DateTime(2019, 09, 09), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Dog(2, "Bouncer", "Welsh Terrier", new DateTime(2019, 09, 09), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Dog(3, "Bonbon", "Bernedoodle", new DateTime(2019, 09, 09), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Dog(4, "Roscoe", "Beagle", new DateTime(2019, 09, 09), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Dog(5, "Neon", "Rottweiler", new DateTime(2019, 09, 09), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Dog(6, "Pudge", "Pug", new DateTime(2019, 09, 09), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Dog(7, "Bruno", "English Stafford", new DateTime(2019, 09, 09), true, true, new DateTime(2019, 10, 13), 1, false),

                        // (int id, string name, string race, DateTime dateOfBirth, bool isChecked, bool kidFriendly, DateTime since, int shelterId, bool declawed)
                        new Cat(1, "Jef", "Tabby", new DateTime(2009, 12, 06), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Cat(2, "Marvin", "Bombay", new DateTime(2009, 12, 06), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Cat(3, "Shaggy", "Highland Fold", new DateTime(2009, 12, 06), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Cat(4, "Toturi", "Russian Blue", new DateTime(2009, 12, 06), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Cat(5, "Wiggle", "Chartreux", new DateTime(2009, 12, 06), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Cat(6, "Mila", "American Shorthair", new DateTime(2009, 12, 06), true, true, new DateTime(2019, 10, 13), 1, false),

                        new Cat(7, "Twizzy", "American Curl", new DateTime(2009, 12, 06), true, true, new DateTime(2019, 10, 13), 1, false),

                        // (int id, string name, string race, string description, DateTime dateOfBirth, bool isChecked, bool kidFriendly, int shelterId, DateTime since)
                        new Other(3, "Hammy", "Gerbil", "This is a hamster", new DateTime(2017, 05, 19), true, true, 1, new DateTime(2019, 10, 13)),
                    }
                };

                shelter.Id   = 1;
                shelter.Name = "VIDA";

                _shelter       = shelter;
                _isInitialized = true;
            }
        }
Example #3
0
        private void AddData()
        {
            var Cats = new List <Cat> {
                new Cat {
                    Id = 1, name = "Felix", DateOfBirth = "19/01/2005", IsChecked = true, KidFriendly = true, DateOfArrival = "23/09/2019", ShelterId = 1, Declawed = true, Race = "Persian"
                },
                new Cat {
                    Id = 2, name = "Bacardi", DateOfBirth = "22/07/2008", IsChecked = true, KidFriendly = false, DateOfArrival = "12/06/2018", ShelterId = 1, Declawed = false, Race = "Chartreux"
                },
                new Cat {
                    Id = 3, name = "Misty", DateOfBirth = "01/01/2001", IsChecked = true, KidFriendly = true, DateOfArrival = "12/06/2009", ShelterId = 1, Declawed = true, Race = "American Shorthair"
                }
            };
            var Dogs = new List <Dog> {
                new Dog {
                    Id = 4, name = "Sparky", DateOfBirth = "19/01/2005", IsChecked = true, KidFriendly = true, DateOfArrival = "23/09/2019", ShelterId = 1, Barker = false, Race = "Husky"
                },
                new Dog {
                    Id = 5, name = "Barky", DateOfBirth = "22/07/2008", IsChecked = true, KidFriendly = false, DateOfArrival = "12/06/2018", ShelterId = 1, Barker = true, Race = "German Sheppard"
                },
                new Dog {
                    Id = 6, name = "Woef", DateOfBirth = "01/01/2001", IsChecked = true, KidFriendly = true, DateOfArrival = "12/06/2009", ShelterId = 1, Barker = true, Race = "Tackle"
                }
            };
            var Cats2 = new List <Cat> {
                new Cat {
                    Id = 7, name = "johnny", DateOfBirth = "19/01/2005", IsChecked = true, KidFriendly = true, DateOfArrival = "23/09/2019", ShelterId = 2, Declawed = true, Race = "streetcat"
                },
                new Cat {
                    Id = 8, name = "wodka", DateOfBirth = "22/07/2008", IsChecked = true, KidFriendly = false, DateOfArrival = "12/06/2018", ShelterId = 2, Declawed = true, Race = "Persian"
                },
                new Cat {
                    Id = 9, name = "Wiskers", DateOfBirth = "01/01/2001", IsChecked = true, KidFriendly = true, DateOfArrival = "12/06/2009", ShelterId = 2, Declawed = false, Race = "streetcat"
                }
            };
            var OtherAnimals = new List <Other> {
                new Other {
                    Id = 10, name = "Gary", DateOfBirth = "19/01/2005", IsChecked = true, KidFriendly = true, DateOfArrival = "23/09/2019", ShelterId = 2, Description = "Gary is a special needs snkae", Kind = "Python snake"
                },
                new Other {
                    Id = 11, name = "Cider", DateOfBirth = "22/07/2008", IsChecked = true, KidFriendly = false, DateOfArrival = "12/06/2018", ShelterId = 2, Description = "cider is an overweight rat", Kind = "Asian Black Rat"
                },
                new Other {
                    Id = 12, name = "Rocky", DateOfBirth = "01/01/2001", IsChecked = true, KidFriendly = true, DateOfArrival = "12/06/2009", ShelterId = 2, Description = "Rocky doesn't move much", Kind = "pet rock"
                }
            };
            var Caretakers = new List <Caretaker> {
                new Caretaker {
                    Name = "Steve", DateOfBirth = "20/04/1990", Gender = "male", Mail = "*****@*****.**"
                },
                new Caretaker {
                    Name = "John", DateOfBirth = "15/06/1969", Gender = "male", Mail = "*****@*****.**"
                },
                new Caretaker {
                    Name = "Becky", DateOfBirth = "01/01/1997", Gender = "male", Mail = "*****@*****.**"
                }
            };

            var _animals  = new List <Animal> {
            };
            var _animals2 = new List <Animal> {
            };

            _animals.AddRange(Cats);
            _animals.AddRange(Dogs);
            _animals2.AddRange(Cats2);
            _animals2.AddRange(OtherAnimals);
            var _employees = new List <Employee> {
            };

            _employees.AddRange(Caretakers);
            var shelter1 = new Shelter {
                name = "shelter Mechelen", Animals = _animals, Employees = _employees
            };
            var shelter2 = new Shelter {
                name = "shelter Leuven", Animals = _animals2, Employees = _employees
            };

            _context.Shelters.Add(shelter1);
            _context.Shelters.Add(shelter2);
            _context.SaveChanges();
        }