开发者

Mapping an nhibernate many-to-one to an inteface

I would like to map an Nhibernate many-to-one property to an interface like the following if that is possible:

public

public interface IContact
{
    Guid Uid { get; set; }
    string FirstName {get;set;}
    //etc. etc.
}

I am fairly sure 开发者_如何学运维I can only map to concrete types but maybe somebody can point out a way?


It's all described in the docs: Chapter 8. Inheritance Mapping

Depending on the chosen strategy, you'll map the reference property as many-to-one (most cases) or any (only if you use implicit polymorphism)


You can map to an interface ... and it works exactly as it does for concrete classes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜