views:

646

answers:

1

How to enable NHibernate Second-Level Cache with NHibernate Linq Provider 1.0 ?

Second-Level Cache seems to work only with ICriteria usage.

+13  A: 

Yes, I finally worked this one out:

public IQuerable<T> CreateLinqQuery()
{
    var query = session.Linq<T>();
    query.QueryOptions.SetCachable(true);
    return query;
}
cbp
Thanks cbp, I'll check this out
Yoann. B