Mapping 引用实体框架中的任何nhibernate映射?

Mapping 引用实体框架中的任何nhibernate映射?,mapping,Mapping,我想知道如何在实体框架中创建映射, 这类似于流利的nhibernate中的引用 我得到的是: 实体: public abstract class Document : Entity { public virtual ICollection<Feature> Features { get; set; } } public class DocumentA : Document { } public class DocumentB : Document { } public

我想知道如何在实体框架中创建映射, 这类似于流利的nhibernate中的引用

我得到的是:

实体:

public abstract class Document : Entity
{
   public virtual ICollection<Feature> Features { get; set; }
}

public class DocumentA : Document 
{
}

public class DocumentB : Document
{
}

public class Feature : Entity
{
    public IEntity Super { get; set; }
    public virtual string Value { get; set; }
}
在要素映射中:

ReferencesAny(x => x.Super)
    .EntityTypeColumn("type")
    .EntityIdentifierColumn("super")
    .AddMetaValue<DocumentA>("DoucmentA")
    .AddMetaValue<DokumentB>("DocumentB")
    .IdentityType<int>();
在文档映射中:

HasMany<Feature>(x => x.Features)
   .AsSet()
   .Inverse()
   .KeyColumn("super").Not.KeyNullable()
   .Where("type = 'DocumentA'")
   .Fetch.Join()
   .Cascade.AllDeleteOrphan();
在DocumentB映射中:

HasMany<Feature>(x => x.Features)
   .AsSet()
   .Inverse()
   .KeyColumn("super").Not.KeyNullable()
   .Where("type = 'DocumentB'")
   .Fetch.Join()
   .Cascade.AllDeleteOrphan();
这种映射为我提供了一个干净的Features表,其中包含以下列:id、value、type、super、, 其中,type充当鉴别器,super是文档id

既然我无法更改它,如何在EF中映射它以实现具有相同列的Features表