public void Ignore_should_add_to_list_of_ignored_types()
        {
            var modelConfiguration = new ModelConfiguration();

            new DbModelBuilder(modelConfiguration).Ignore <object>();

            Assert.True(modelConfiguration.IsIgnoredType(typeof(object)));
        }
        public void Apply_should_ignore_type()
        {
            var mockType           = new MockType();
            var modelConfiguration = new ModelConfiguration();

            new NotMappedTypeAttributeConvention()
            .Apply(mockType, modelConfiguration, new NotMappedAttribute());

            Assert.True(modelConfiguration.IsIgnoredType(mockType));
        }
Exemplo n.º 3
0
        public void MapComplexType_should_recognize_StoreIgnore_over_StoreInline()
        {
            var type  = typeof(TypeMapper_EntityWithStoreInlineAndStoreIgnore);
            var model = new EdmModel(DataSpace.CSpace);
            var modelConfiguration = new ModelConfiguration();
            var typeMapper         = new TypeMapper(new MappingContext(modelConfiguration, new ConventionsConfiguration(), model));

            typeMapper.MapComplexType(type);

            Assert.True(modelConfiguration.IsIgnoredType(type));
            Assert.Equal(0, model.EntityTypes.Count());
            Assert.Equal(0, model.ComplexTypes.Count());
        }
Exemplo n.º 4
0
        public void MapComplexType_should_recognize_StoreIgnore()
        {
            var type  = typeof(TypeMapper_EntityWithStoreIgnore);
            var model = new EdmModel().Initialize();
            var modelConfiguration = new ModelConfiguration();
            var typeMapper         = new TypeMapper(new MappingContext(modelConfiguration, new ConventionsConfiguration(), model));

            typeMapper.MapComplexType(type);

            Assert.True(modelConfiguration.IsIgnoredType(type));
            Assert.Equal(0, model.Namespaces.Single().EntityTypes.Count);
            Assert.Equal(0, model.Namespaces.Single().ComplexTypes.Count);
        }
        public void Ignore_should_add_property_to_list_of_ignored_properties()
        {
            var modelConfiguration = new ModelConfiguration();

            modelConfiguration.Ignore(typeof(string));

            Assert.True(modelConfiguration.IsIgnoredType(typeof(string)));
        }