当前位置: 首页>>代码示例>>C#>>正文


C# ModelConfiguration.IsIgnoredType方法代码示例

本文整理汇总了C#中System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.IsIgnoredType方法的典型用法代码示例。如果您正苦于以下问题:C# ModelConfiguration.IsIgnoredType方法的具体用法?C# ModelConfiguration.IsIgnoredType怎么用?C# ModelConfiguration.IsIgnoredType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration的用法示例。


在下文中一共展示了ModelConfiguration.IsIgnoredType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Apply_should_ignore_type

        public void Apply_should_ignore_type()
        {
            var mockType = new MockType();
            var modelConfiguration = new ModelConfiguration();

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

            Assert.True(modelConfiguration.IsIgnoredType(mockType));
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:10,代码来源:NotMappedTypeAttributeConventionTests.cs

示例2: Ignore_type_configures

        public void Ignore_type_configures()
        {
            var type = typeof(LocalEntityType);
            var innerConfig = new ModelConfiguration();
            var config = new ConventionTypeConfiguration<LocalEntityType>(type, innerConfig);

            config.Ignore();

            Assert.True(innerConfig.IsIgnoredType(typeof(LocalEntityType)));
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:10,代码来源:ConventionTypeConfigurationOfTypeTests.cs

示例3: Ignore_should_add_property_to_list_of_ignored_properties

        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)));
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:ModelConfigurationTests.cs

示例4: MapComplexType_should_recognize_StoreIgnore_over_StoreInline

        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());
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:13,代码来源:TypeMapperTests.cs

示例5: MapComplexType_should_recognize_StoreIgnore

        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);
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:13,代码来源:TypeMapperTests.cs


注:本文中的System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.IsIgnoredType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。