views:

39

answers:

1
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.

A: 

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.

Sam
Was this the answer you were looking for? If so, please mark it as such, if not indicate as such so that other people can chip in. Cheers S
Sam

related questions