After some digging around in the source Ive found what the problem is
Firstly MS mangles the class names for Templated classes
so for
public abstract class TemplatedClass<T1,T2>
the actual name of the type is TemplatedClass`2.
This is not a problem as I simply changed the name of the mapping file and the name attribute accordingly BUT it still failed
After further digging Ive found that a new DynamicMethod object is being created with the templated class as the owner....but unfortunately according to the MS documentation an ArgumentException is thrown if
"owner is an interface, an array, an open generic type, or a type parameter of a generic type or method."
So it looks like it is impossible in NHibernate to use a subclass of an abstract templated class (where the subclass supplies the template)
In my app I have a bunch of applications which contain an IList<UserType> - each application then specifies the type of user it can hold when deriving from the base abstract Application<UserType> class
anyone any suggestions ????
thanks
W
|