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


C# ModelConfiguration.IsComplexType方法代码示例

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


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

示例1: Apply_should_inline_type

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

            new ComplexTypeAttributeConvention.ComplexTypeAttributeConventionImpl()
                .Apply(mockType, modelConfiguration, new ComplexTypeAttribute());

            Assert.True(modelConfiguration.IsComplexType(mockType));
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:10,代码来源:ComplexTypeAttributeConventionTests.cs

示例2: IsComplexType_configures

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

            config.IsComplexType();

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

示例3: IsComplexType_should_return_true_when_type_is_complex

        public void IsComplexType_should_return_true_when_type_is_complex()
        {
            var modelConfiguration = new ModelConfiguration();
            modelConfiguration.Add(new Mock<ComplexTypeConfiguration>(typeof(object)).Object);

            Assert.True(modelConfiguration.IsComplexType(typeof(object)));
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:7,代码来源:ModelConfigurationTests.cs

示例4: MapEntityType_recognizes_TableName

        public void MapEntityType_recognizes_TableName()
        {
            var type = typeof(TypeMapper_EntityWithTableName);
            var model = new EdmModel(DataSpace.CSpace);
            var modelConfiguration = new ModelConfiguration();
            var typeMapper = new TypeMapper(new MappingContext(modelConfiguration, new ConventionsConfiguration(), model));

            typeMapper.MapEntityType(type);

            Assert.False(modelConfiguration.IsComplexType(type));
            Assert.Equal(1, model.EntityTypes.Count());
            Assert.Equal(0, model.ComplexTypes.Count());
            Assert.Equal("Foo", modelConfiguration.Entity(typeof(TypeMapper_EntityWithTableName)).GetTableName().Name);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:14,代码来源:TypeMapperTests.cs

示例5: MapComplexType_should_recognize_StoreInline

        public void MapComplexType_should_recognize_StoreInline()
        {
            var type = typeof(TypeMapper_EntityWithStoreInline);
            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.IsComplexType(type));
            Assert.Equal(0, model.EntityTypes.Count());
            Assert.Equal(1, model.ComplexTypes.Count());
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:13,代码来源:TypeMapperTests.cs

示例6: MapEntityType_should_recognize_StoreInline

        public void MapEntityType_should_recognize_StoreInline()
        {
            var type = typeof(TypeMapper_EntityWithStoreInline);
            var model = new EdmModel().Initialize();
            var modelConfiguration = new ModelConfiguration();
            var typeMapper = new TypeMapper(new MappingContext(modelConfiguration, new ConventionsConfiguration(), model));

            typeMapper.MapEntityType(type);

            Assert.True(modelConfiguration.IsComplexType(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.IsComplexType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。