简体   繁体   English

使用IAutoMappingOverride使流利的hhibernate中的每种类型的表

[英]Table per type in fluent nhibernate using IAutoMappingOverride

Is it possible to create a Table Per Type mapping using fluent nhibernate with only the IAutoMappingOverride interface? 是否可以仅使用IAutoMappingOverride接口使用流利的nhibernate创建每个类型的表映射? I really want to avoid writing out a full mapping for my models. 我真的想避免为模型写出完整的映射。

Not using IAutomappingOverride but with AutomappingConfiguration 不使用IAutomappingOverride而是使用IAutomappingOverride

class MyAutomappingConfiguration : DefaultAutomappingConfiguration
{
    public override bool IsDiscriminated(Type type)
    {
        return false; // or whatever classes it should discriminate instead of table per type
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM