我相信这是小菜一碟,但使用谷歌,我不能找到它。 我需要从映射排除单个类。 我现在的配置是:
return Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2005.ConnectionString(c =>
c.Is(@"Data Source=PC\SQLEXPRESS;......")))
.Mappings(m =>
m.AutoMappings.Add(
AutoPersistenceModel.MapEntitiesFromAssemblyOf<Person2>()
.Where(t => t.Namespace == "ExampleData.HumansTest")
.UseOverridesFromAssemblyOf<PersonMappingOverrides>()
.ConventionDiscovery.AddFromAssemblyOf<PersonMappingOverrides>()
)
).BuildConfiguration();
工作良好,那么远,但我有一些类我不想映射。 有像什么:
伪代码:
return Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2005.ConnectionString(c =>
c.Is(@".......")))
.Mappings(m =>
m.AutoMappings.Add(
AutoPersistenceModel.MapEntitiesFromAssemblyOf<Person2>()
.Where(t => t.Namespace == "ExampleData.HumansTest")
.DO_NOT_MAP_CLASS<UnfinishedClass>
.UseOverridesFromAssemblyOf<PersonMappingOverrides>()
.ConventionDiscovery.AddFromAssemblyOf<PersonMappingOverrides>()
)
).BuildConfiguration();