public static IDataServiceQueryable <TEntity, TBase> Where <TEntity, TBase>(this IDataServiceQueryable <TEntity, TBase> queriable, RLinq.LambdaExpression expression) where TEntity : TBase where TBase : Entity
        {
            var newQueriable = new DataServiceQueryableImp <TEntity, TBase>((DataServiceQueryable <TEntity, TBase>)queriable);

            newQueriable.Filters.Add(new DataServiceQueryable <TEntity, TBase> .Filter(expression));
            return(newQueriable);
        }
        public static IOrderedDataServiceQueryable <TEntity, TBase> OrderByDescending <TEntity, TBase>(this IDataServiceQueryable <TEntity, TBase> queriable, RLinq.LambdaExpression expression) where TEntity : TBase where TBase : Entity
        {
            var newQueriable = new OrderedDataServiceQueryable <TEntity, TBase>((DataServiceQueryable <TEntity, TBase>)queriable);

            newQueriable.Sortings.Clear();
            newQueriable.Sortings.Add(new DataServiceQueryable <TEntity, TBase> .Sort(expression, RLinq.SortDirection.Descending));
            return(newQueriable);
        }
Exemplo n.º 3
0
 public static SystemLinq.LambdaExpression ToLinqExpression(this RemoteLinq.LambdaExpression expression, ITypeResolver?typeResolver)
 => ToLinqExpression(expression, GetExpressionTranslatorContextOrNull(typeResolver));
Exemplo n.º 4
0
        /// <summary>
        /// Translates a given query expression into a lambda expression.
        /// </summary>
        public static SystemLinq.Expression <Func <T, TResult> > ToLinqExpression <T, TResult>(this RemoteLinq.LambdaExpression expression)
        {
            var exp = expression.ToLinqExpression();
            var lambdaExpression = SystemLinq.Expression.Lambda <Func <T, TResult> >(exp.Body, exp.Parameters);

            return(lambdaExpression);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Translates a given remote linq expression into a lambda expression.
 /// </summary>
 public static SystemLinq.LambdaExpression ToLinqExpression(this RemoteLinq.LambdaExpression expression, IExpressionFromRemoteLinqContext?context = null)
 => (SystemLinq.LambdaExpression) new RemoteToSystemLinqTranslator(context ?? ExpressionTranslatorContext.Default).ToExpression(expression);