开发者

Multiple Interface implementaion property mapping - NHibernate

开发者 https://www.devze.com 2023-03-09 15:15 出处:网络
Hi everyone I\'m faced with the following issue, to which i\'m sure there must be a solution but i cannot seems to find one.

Hi everyone I'm faced with the following issue, to which i'm sure there must be a solution but i cannot seems to find one.

Looking at the following small piece of code (assuming ID's and all exists):

interface IBehave
{}

class A : IBehave
{}

class B : IBehave
{}

class Owner
{
    IBehave Behave { get; set; }
}

Here's what i'm looking to accomplish: Assuming A and B are already mapped by their concrete classes I want to ma开发者_开发百科p the Owner class in such a way that querying it will instantiate the correct interface implementation as the property.

Thanks for the help!

0

精彩评论

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

关注公众号