public void MapEntityType_should_create_entity_type_with_clr_type_name_and_add_to_model() { var model = new EdmModel().Initialize(); 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")); }
public void GetEntityType_should_return_correct_type() { var model = new EdmModel().Initialize(); var entityType = model.AddEntityType("Foo"); var foundEntityType = model.GetEntityType("Foo"); Assert.NotNull(foundEntityType); Assert.Same(entityType, foundEntityType); }
internal void ConfigureEntities(EdmModel model) { //Contract.Requires(model != null); foreach (var entityTypeConfiguration in ActiveEntityConfigurations) { var structuralType = entityTypeConfiguration.ClrType; var entityType = model.GetEntityType(structuralType); Contract.Assert(entityType != null); entityTypeConfiguration.Configure(entityType, model); } }