I have the following query:

Session.Linq<FooBar>()
    .SetCachable(true)
    .SetCacheRegion("foobar")
    .Select(x => new Baz(x.Foo, x.Bar))
    .ToList();


This works when caching is turned off, but with caching enabled I
receive the following exception:

System.InvalidCastException: Unable to cast object of type 'Baz' to
type 'System.Object[]'.



The rest of the stack cache is:

at NHibernate.Cache.StandardQueryCache.Put(QueryKey key,
ICacheAssembler[] returnTypes, IList result, Boolean
isNaturalKeyLookup, ISessionImplementor session)
at NHibernate.Loader.Loader.PutResultInQueryCache(ISessionImplementor
session, QueryParameters queryParameters, IType[] resultTypes,
IQueryCache queryCache, QueryKey key, IList result)
at NHibernate.Loader.Loader.ListUsingQueryCache(ISessionImplementor
session, QueryParameters queryParameters, ISet`1 querySpaces, IType[]
resultTypes)
at NHibernate.Loader.Loader.List(ISessionImplementor session,
QueryParameters queryParameters, ISet`1 querySpaces, IType[]
resultTypes)
at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList
results)

--

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


Reply via email to