public void Generates_filter_string(string expected, Expression expression) { var select = new SelectExpression(typeof(PocoTestType)); select.Predicate = expression; Assert.Equal(expected, _generator.GenerateTableQuery(select).FilterString); }
public void Generates_take_value() { var count = 38974; var expression = new SelectExpression(typeof(PocoTestType)) { Take = new TakeExpression(typeof(PocoTestType), count) }; Assert.Equal(count, _generator.GenerateTableQuery(expression).TakeCount); }
protected override Expression VisitEntityQueryable(Type elementType) { var query = new SelectExpression(elementType); _parent._queriesBySource[_querySource] = query; var entityType = _parent.QueryCompilationContext.Model.GetEntityType(elementType); return Expression.Call( _executeQueryMethodInfo.MakeGenericMethod(elementType), QueryContextParameter, Expression.Constant(entityType), Expression.Constant(query) ); }
public void Generates_ignores_missing_take_value() { var expression = new SelectExpression(typeof(PocoTestType)); Assert.Null(_generator.GenerateTableQuery(expression).TakeCount); }