protected override LinqExpression VisitQuerySource(QuerySourceExpression expr)
 {
     if (rootCriteria == null)
     {
         if (!string.IsNullOrEmpty(this.entityName))
             rootCriteria = session.CreateCriteria(entityName, expr.Alias);
         else
             rootCriteria = session.CreateCriteria(expr.ElementType, expr.Alias);
         options.Execute(rootCriteria);
     }
     return expr;
 }
Esempio n. 2
0
        protected override LinqExpression VisitQuerySource(QuerySourceExpression expr)
        {
            if (rootCriteria == null)
            {
                if(!string.IsNullOrEmpty(this.entityName))
                    rootCriteria = session.CreateCriteria(entityName, expr.Alias);
                else
                    rootCriteria = session.CreateCriteria(expr.ElementType, expr.Alias);

                System.Type t= options.GetType();
                System.Reflection.FieldInfo f = t.GetField("action", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
                var action = f.GetValue(options) as Action<ICriteria>;
                action(rootCriteria);

            }
            return expr;
        }
 protected override Expression VisitQuerySource(QuerySourceExpression expr)
 {
     if (castedType != null)
         return new QuerySourceExpression(expr.Alias, expr.Query, castedType);
     return base.VisitQuerySource(expr);
 }
 protected virtual Expression VisitQuerySource(QuerySourceExpression expr)
 {
     return expr;
 }