We are on nhibernate 1.2 and have been able to implement our own
custom list collections but when we tried to implement a custom
dictionary collection we get the following error:

"Unknown entity class: System.Collections.Generic.KeyValuePair`2

I debugged into it and found when using a custom dictionary it uses
the base CollectionType class for the dictionary collection and the
framework ends up call this method in this class:

public virtual ICollection GetElementsCollection(object collection)
                {
                        return ((ICollection) collection);
                }


I then debugged it using the standard dictionary and it ended up using
the MapType class which inherits CollectionType and its method looks
like this:

public override ICollection GetElementsCollection(object collection)
                {
                        return ((IDictionary) collection).Values;
                }

notice the first one returns the collection which is why the error
about unknow entity class is being raised since it ends up returning a
collection of key value pairs rather than a collection of objects as
what the MapType class does.
So , I how can we somehow get it to use the MapType class since using
a custom type always forces the use of the CollectionType class. If
anyone has an example of doing a custom dictionary collection , that
would be great too.

thanks

scott
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to