public void Can_create_DbSet_for_abstract_base_type()
        {
            using (var context = new AdvancedPatternsMasterContext())
            {
                var set = context.Set<Employee>();
                Assert.IsType<DbSet<Employee>>(set);

                var entity = set.FirstOrDefault();
                Assert.IsAssignableFrom<Employee>(entity);
            }
        }
        public void Can_create_non_generic_DbSet_for_abstract_base_type()
        {
            using (var context = new AdvancedPatternsMasterContext())
            {
                var set = context.Set(typeof(Employee));
                Assert.Equal(typeof(Employee), set.ElementType);

                var entity = set.Cast<Employee>().FirstOrDefault();
                Assert.IsAssignableFrom<Employee>(entity);
            }
        }
        public void Non_generic_DbSet_Create_works_under_partial_trust()
        {
            using (var context = new AdvancedPatternsMasterContext())
            {
                var building = context.Set(typeof(Building)).Create(typeof(Building));

                Assert.NotNull(building);
                Assert.IsAssignableFrom<Building>(building);
                Assert.IsNotType<Building>(building);
            }
        }