Your property is of the concrete type HashSet, this won't work. NHibernate needs to create a proxy of the collection to be able to do lazy loading, and it can only do that for interfaces (and classes with all methods as virtual). Try setting your property to an ISet or some other collection interface.
On Fri, Jul 24, 2009 at 6:08 AM, dnagir <[email protected]> wrote: > > Hi Chris, > > I've tried AsSet. > Now I get the exception from NH: > Unable to cast object of type > 'NHibernate.Collection.Generic.PersistentGenericSet`1 > [SecurityPrivilege]' to type 'System.Collections.Generic.HashSet`1 > [SecurityPrivilege]'. > > It seems I can't get System.Collections.Generic.HashSet get working > with NH. > > Probably I have to ask in the NH group. > > Thanks. > > > target.AsSet().Access.AsCamelCaseField(); > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" 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/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
