Exemplo n.º 1
0
 public LambdaBetweenBuilder(TReturn root, ExpressionProcessor.ProjectionInfo projection, bool isNot, object lo)
 {
     this.root       = root;
     this.projection = projection;
     this.isNot      = isNot;
     this.lo         = lo;
 }
        public static ICriterion ProcessIsLike(MethodCallExpression methodCallExpression)
        {
            ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(methodCallExpression.Arguments[0]);
            object value = ExpressionProcessor.FindValue(methodCallExpression.Arguments[1]);

            return(projection.CreateCriterion(Restrictions.Like, Restrictions.Like, value));
        }
        public static ICriterion ProcessIsInCollection(MethodCallExpression methodCallExpression)
        {
            ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(methodCallExpression.Arguments[0]);
            ICollection values = (ICollection)ExpressionProcessor.FindValue(methodCallExpression.Arguments[1]);

            return(projection.Create <ICriterion>(s => Restrictions.In(s, values), p => Restrictions.In(p, values)));
        }
        public static ICriterion ProcessIsLikeMatchMode(MethodCallExpression methodCallExpression)
        {
            ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(methodCallExpression.Arguments[0]);
            string    value     = (string)ExpressionProcessor.FindValue(methodCallExpression.Arguments[1]);
            MatchMode matchMode = (MatchMode)ExpressionProcessor.FindValue(methodCallExpression.Arguments[2]);

            return(projection.Create <ICriterion>(s => Restrictions.Like(s, value, matchMode), p => Restrictions.Like(p, value, matchMode)));
        }
        public static ICriterion ProcessIsBetween(MethodCallExpression methodCallExpression)
        {
            MethodCallExpression betweenFunction = (MethodCallExpression)methodCallExpression.Object;

            ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(betweenFunction.Arguments[0]);
            object lo = ExpressionProcessor.FindValue(betweenFunction.Arguments[1]);
            object hi = ExpressionProcessor.FindValue(methodCallExpression.Arguments[0]);

            return(projection.Create <ICriterion>(s => Restrictions.Between(s, lo, hi), p => Restrictions.Between(p, lo, hi)));
        }
Exemplo n.º 6
0
 /// <summary>
 /// Constructed with property name
 /// </summary>
 public QueryOverRestrictionBuilderBase(TReturn root, ExpressionProcessor.ProjectionInfo projection)
 {
     this.root       = root;
     this.projection = projection;
 }
Exemplo n.º 7
0
 public IQueryOverRestrictionBuilder(IQueryOver <TRoot, TSubType> root, ExpressionProcessor.ProjectionInfo projection)
     : base(root, projection)
 {
 }
Exemplo n.º 8
0
 /// <summary>
 /// Build an ICriterion for the given property
 /// </summary>
 /// <param name="expression">lambda expression identifying property</param>
 /// <returns>returns LambdaRestrictionBuilder</returns>
 public static LambdaRestrictionBuilder On(Expression <Func <object> > expression)
 {
     ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(expression.Body);
     return(new LambdaRestrictionBuilder(projection));
 }
Exemplo n.º 9
0
 protected QueryOverOrderBuilderBase(TReturn root, ExpressionProcessor.ProjectionInfo projection)
 {
     this.root       = root;
     this.projection = projection;
 }
Exemplo n.º 10
0
 public QueryOverOrderBuilder(QueryOver <TRoot, TSubType> root, ExpressionProcessor.ProjectionInfo projection) : base(root, projection)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Constructed with property name
 /// </summary>
 public LambdaRestrictionBuilder(ExpressionProcessor.ProjectionInfo projection)
 {
     this.projection = projection;
 }
Exemplo n.º 12
0
 public LambdaBetweenBuilder(ExpressionProcessor.ProjectionInfo projection, object lo, bool isNot)
 {
     this.projection = projection;
     this.lo         = lo;
     this.isNot      = isNot;
 }