Hello,
I have a question about a many-to-many association. I guess it will be the best to describe my question with an example.
I have one class containing al list object.
Code:
class MyList
{
private List<IAnimal> myAnimals = new List<IAnimal>();
public List<IAnimal> MyAnimals
{
get{ return myAnimals ; }
set{ myAnimals = value; }
}
}
and a second class representing (for example) a dog. This class implements the IAnimal interface that I want to use in the MyList-Class.
Code:
class Dog : IAnimal
{
private String name = "";
public String Name;
{
get{ return name; }
set{ name= value; }
}
}
In the MyList-Class I used the generic List<IAnimal> list to point out that I have a list, containing several object types (btw. I'm free to use any other "List-Type" if necessary)
I am new to NHibernate and all the examples (I have read so far) demonstrate a many-to-many accociation with a constant object-type. (At least that's how I understood the examples ;-) ).
My question is if it is possible to map such "multi-type-lists" with NHibernate and if the answer is yes, it would be great when someone could tell me how to do this :-).
I want to thank you for your answers.
SunX