public override IQueryable <TModel> GetAll(ISession currentSession) { global::NHibernate.ISession nativeSession = GetNativeSession(currentSession); nativeSession.Clear(); IQueryable <TModel> queryable = Query(currentSession); return(queryable); }
public override IQueryable <TModel> GetById <TId>(ISession currentSession, TId id) { global::NHibernate.ISession nativeSession = GetNativeSession(currentSession); nativeSession.Clear(); IClassMetadata classMetadata = nativeSession.SessionFactory.GetClassMetadata(modelType); Expression <Func <TModel, bool> > expression = BuildGetByIdExpression(classMetadata, id); IQueryable <TModel> queryable = Query(currentSession); IQueryable <TModel> result = queryable.Where(expression); return(result); }