yoni
yoni

Reputation: 191

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.

Upvotes: 0

Views: 100

Answers (1)

Sam
Sam

Reputation: 1514

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.

Upvotes: 1

Related Questions