本文整理汇总了C#中System.Data.Entity.Core.Metadata.Edm.EdmModel.GetEntityType方法的典型用法代码示例。如果您正苦于以下问题:C# EdmModel.GetEntityType方法的具体用法?C# EdmModel.GetEntityType怎么用?C# EdmModel.GetEntityType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Entity.Core.Metadata.Edm.EdmModel
的用法示例。
在下文中一共展示了EdmModel.GetEntityType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEntityType_should_return_correct_type
public void GetEntityType_should_return_correct_type()
{
var model = new EdmModel(DataSpace.CSpace);
var entityType = model.AddEntityType("Foo");
var foundEntityType = model.GetEntityType("Foo");
Assert.NotNull(foundEntityType);
Assert.Same(entityType, foundEntityType);
}
示例2: ConfigureEntities
private void ConfigureEntities(EdmModel model)
{
DebugCheck.NotNull(model);
foreach (var entityTypeConfiguration in ActiveEntityConfigurations)
{
var structuralType = entityTypeConfiguration.ClrType;
var entityType = model.GetEntityType(structuralType);
Debug.Assert(entityType != null);
entityTypeConfiguration.Configure(entityType, model);
}
}
示例3: MapEntityType_should_create_entity_type_with_clr_type_name_and_add_to_model
public void MapEntityType_should_create_entity_type_with_clr_type_name_and_add_to_model()
{
var model = new EdmModel(DataSpace.CSpace);
var typeMapper = new TypeMapper(new MappingContext(new ModelConfiguration(), new ConventionsConfiguration(), model));
var mockType = new MockType("Foo");
var entityType = typeMapper.MapEntityType(mockType);
Assert.NotNull(entityType);
Assert.Same(entityType, model.GetEntityType("Foo"));
}
示例4: ConfigureEntities
private void ConfigureEntities(EdmModel model)
{
DebugCheck.NotNull(model);
foreach (var entityTypeConfiguration in ActiveEntityConfigurations)
{
ConfigureFunctionMappings(model, entityTypeConfiguration, model.GetEntityType(entityTypeConfiguration.ClrType));
}
foreach (var entityTypeConfiguration in ActiveEntityConfigurations)
{
entityTypeConfiguration.Configure(model.GetEntityType(entityTypeConfiguration.ClrType), model);
}
}