本文整理汇总了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));
}
示例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)));
}
示例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)));
}
示例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);
}
示例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());
}
示例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);
}