Questions tagged [expressionvisitor]
The expressionvisitor tag has no usage guidance.
expressionvisitor
52
questions
1
vote
1
answer
46
views
Expression Visitor access property on parameter representing local variable
Trying to write an ExpressionVisitor that would rewrite a query
Starting point
var contractSubjectKey = new ContractSubjectKey(subjectId, rank);
insurance = context.Set<Insurance>()
....
1
vote
1
answer
455
views
I get a 'must be reducible node' error when calling `Compile()` on a Lamda Expression from `ExpressionVisitor`
I upgraded to from EFCore 3 to EFCore 6 and I get this error must be reducible node.
I use Postgresql has my database.
The error come from the Compile statement:
private IQueryable<T> ...
0
votes
1
answer
358
views
How to Translate C# Expression to Custom Nested (recursive) Class structure?
I've custom Query Class which will be used to build query with help of lambda expression like below
var query = new Query("Person").Where<Person>(p =>
(p.Name == "Maulik" &...
0
votes
1
answer
300
views
Get DateTime value From FieldInfo
I am tryning to retrieve a DateTime via reflection. The value is not inside a class or a static class, but it is from a lambda expression...
I have this really simple lambda expression: ATest => ...
1
vote
0
answers
258
views
using ExpressionVisitor how to dynamically get evaluate value of expression of a ParameterExpression
I have an expression that takes an expression as one of its parameters:
I am using a ExpressionVisitor to get the values of constants see this SO post.
but if a member is a memberAccess type I want ...
0
votes
0
answers
361
views
Antlr Cpp templated visitor class
Is there any possibility of templated visitors in AntlrCpp similar to Java implementation?
I've a BaseExpression class that I want to return from my visitors but for the sub-rules, I'd like to return ...
3
votes
0
answers
651
views
How to modify MemberBinding expression using Expression Visitor
I am trying to modify MemberBinding expression using Expression visitor. But I am getting an error when I try to compile the modified expression which says:
'variable 'source' of type 'EFTest.Views....
1
vote
0
answers
163
views
Transform ExpressionVisitor to DbExpressionVisitor, read parameter as constant
I currently have some ExpressionVisitors I manually use on some IQueryable calls
But I would like to use an interceptor to hook them into all queries, but then I need to transform them to ...
1
vote
1
answer
595
views
LINQ extension method to create Where query
I am trying to create an extension method that will be usable for both LINQ-to-Object and LINQ-to-Entities for creating a functioning Where query. More will go into it eventually but to start I am ...
0
votes
0
answers
3k
views
Entity Framework Core PostgreSQL Linq to SQL Json Field
Sorry for my bad English
Note: Npgsql does not supporting json query with EF Core Mapping directly
As yo know PostgreSQL is supporting json and hybrid data. And if you want to query, you can use ...
1
vote
1
answer
247
views
How to call a function or property in a LINQ Query Provider (ExpressionVisitor)
I am creating a LINQ Provider. And the query could look like this:
customers.Where( (f) => f.Date < DateTime.Now )
In my Query provider I Execute an ExpressionVisitor that reads the query and ...
3
votes
1
answer
129
views
C# Expression visitor, how to negate build filters
Im building my own IQuerable implementation for a third party api.
This Api accepts filters as a list of OR's contaiing a list of AND statements and fitlers accordingly, like this:
public class Or {
...
0
votes
1
answer
450
views
Create Arithmetic Formula using ExpressionVisitor
I am trying to create a dynamic formula via entity framework lambda from the columns of a model
public class OutputModel
{
public decimal Result {get;set;}
}
public class TableTest
{
public ...
1
vote
1
answer
358
views
Trouble with generics when trying port the LOX language implementation from the Crafting Interpreter's book to C#
I have recently caught the language bug, and as part of my learning process I have begun working my way through the Crafting Interpreters book by Bob Nystrom and attempting to recreate the JLOX ...
1
vote
1
answer
1k
views
Replace parameter value in Expression Tree with a complex Expression
I'm replacing a ParameterExpression with another with the following method:
public static Expression ReplaceParameter( this Expression expression,
ParameterExpression parameter, string name )
{
...