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