开发者

fluent map one to many

Class Person  
{  
   int ID;
   IList<Cat> cats;  
}  

Class Cat  
{  
   int OwnerId;
}

how to map person cats on nhibernate fluent?

probably stupid question but i cant find the 开发者_开发百科answer..

thank you all.


How about:

public class PersonMap : ClassMap<Person>
{
   Id(p => p.ID);
   HasMany(p => p.Cats);
}

Assuming you have a Cats property in there somewhere of course.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜