Beispiel #1
0
        static void Main(string[] args)
        {
            var ctx = new SampleDbContext();
            var people = ctx.People.ToList();
            Console.WriteLine("exit");

        }
Beispiel #2
0
        static void Main(string[] args)
        {
            using (var ctx = new SampleDbContext())
            {

                var allPeople  = ctx.People.ToList();
                var teacher = ctx.People.OfType<Teacher>().ToList();
                Console.WriteLine(allPeople.Count);
                Console.WriteLine(teacher.Count);
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }