Ejemplo n.º 1
0
        private static void AddADog(string name)
        {
            using (var context = new TphContext())
            {
                Animal dog = new Dog()
                {
                    Name = name,
                    Type = "DOG"
                };

                context.Animals.Add(dog);
                context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        private static void AddACat(string name)
        {
            using (var context = new TphContext())
            {
                Animal cat = new Cat()
                {
                    Name = name,
                    Type = "CAT"
                };

                context.Animals.Add(cat);
                context.SaveChanges();
            }
        }