Skip to main content
Filter by
Sorted by
Tagged with
6 votes
1 answer
191 views

I'm experimenting with C# Expression Trees and trying to understand the difference between Expression.Return and Expression.Goto. I can’t create an example where Return and Goto behave differently ...
Neomaster's user avatar
2 votes
1 answer
112 views

I am trying to implement a LINQ Expression Visitor ([ExpressionVisitor][1]) for the following scenario: remove all pagination-related calls, such as Skip, Take, OrderBy, and OrderByDescending. What I ...
Ricardo Peres's user avatar
0 votes
1 answer
59 views

I'm trying to write a "relaxed" comparison method which operates on Expressions and is used in Entity Framework. It consists of a chain of Replace() calls and ToLower() to perform an inexact ...
Daniel Vernall's user avatar
0 votes
1 answer
106 views

How can I find all the entity types referenced by the Expression passed to IQueryExpressionInterceptor.QueryCompilationStarting? Where in the expression tree should I look for them? I've tried a ...
Kevin Krumwiede's user avatar
2 votes
2 answers
99 views

I want to subscribe to any event existing on a given object, where I don't know the type in advance. I'm generatig event handler at run-time using System.Linq.Expressions.Expression. The code I have (...
Timur Kelman's user avatar
2 votes
2 answers
197 views

I am writing a database query using LINQ in .NET and I want to be able to not duplicate the code I put in my Where method calls. I want to return Blogs that have fresh Comments, and want to filter ...
MonstraG's user avatar
  • 390
2 votes
1 answer
101 views

I'm not able to find the way how to compile the deserialized Expression using Serialize.Linq. The accepted answer in "Compile Expression at runtime Using Serialize.Linq" doesn't work (part 2 ...
rotabor's user avatar
  • 5,611
0 votes
1 answer
58 views

I want to reuse Expression instances for another Expression building like in the code below. Is it safe? Are there any pitfalls with it? using System.Linq.Expressions; class Program { static void ...
Nikita Andreev's user avatar
2 votes
0 answers
61 views

I'm using the solution from this answer to form an Expression<Func<Proposal, bool>> object (where Proposal is an entity type in my app), according to the searching criteria input on a ...
Jyunhao Shih's user avatar
  • 1,478
0 votes
0 answers
480 views

I'm using radzen to build a filter and apply it to a view that acts as my data set. Most everything works fine however when I try to filter by DateTime I get an error Conversion failed when ...
adc90's user avatar
  • 313
0 votes
2 answers
124 views

I need to append methods to an existion experssion and combine them into a new resultExpression. Expression<TSource, IQueryable<TResult>> sourceExpression; Expression<TSource, int, int, ...
Vlad Nan's user avatar
0 votes
3 answers
109 views

I am trying to use C# object initializer syntax with LINQ Expressions trees and I used type conversions (i.e. Expression.Convert) so I shouldn't get invalid cast exceptions for simple type conversions ...
Node.JS's user avatar
  • 1,714
0 votes
1 answer
392 views

I'm trying to use an ExpressionVisitor to change a expression to be used on another underlying type. Assume I have 2 class Foo and Bar, where Bar is a logical representation and Foo is a EF entity. So ...
Stijn Van Antwerpen's user avatar
0 votes
1 answer
251 views

I wrote a simple utility method that accepts a lambda expression of the form x => x.PropertyName, and I want to validate that the expression is indeed of the correct form (the method then does ...
Arnon Axelrod's user avatar
0 votes
0 answers
174 views

Func<T, TField> GetFunc<T, TField> (this FieldInfo fieldInfo) { var instanceParameter = Expression.Parameter (typeof (T), "instance"); var fieldExpression = ...
uchifune's user avatar
0 votes
0 answers
49 views

Given the following code: using System; using System.Linq.Expressions; Console.WriteLine(Expression.Lambda<Func<string>>(Expression.TryFault(Expression.Constant("hi"), ...
binki's user avatar
  • 8,414
0 votes
1 answer
519 views

I'm trying to create a Linq Expression to compare a date column with DateTime.Now Here's my code private void ProcessQueueEntries() { _logger.LogInformation("ProcessQueueEntries"); ...
Simon Woods's user avatar
  • 1,015
1 vote
0 answers
211 views

Hi I am having problem with this expressions: I am creating List of two expression for OrderBy(orderby(first from list).thenby(second from list)), but in some cases Recipient can be null. List<...
luprok's user avatar
  • 11
0 votes
1 answer
344 views

I have a search setup to return matching Record objects based on criteria. It builds an Expression Tree based on the type of criteria and queries the database to return matches. Previously, it only ...
Valuator's user avatar
  • 3,697
0 votes
1 answer
4k views

I need to create a Linq query having Where and Select both dynamic.I am searching something like below code which will work in .net core. var result = myQuery .Where("Field1=\"SomeValue\&...
user3501613's user avatar
0 votes
1 answer
831 views

i have the following method that returns a "value parser" delegate according to the input type. it works fine but i'd like to get rid of the switch statements and type checks and be able to ...
Dĵ ΝιΓΞΗΛψΚ's user avatar
3 votes
1 answer
1k views

I want to create predicate expression so that it translates into WHERE clause with SQL parameter, e.g.: WHERE e.Id = @id_1; I have this code int id = 1; Expression<Func<Entity, int>> ...
Liero's user avatar
  • 27.8k
1 vote
2 answers
2k views

I'm looking to create a slick helper function that compares two values, returns true if they are different, and also updates the first value to equal the second value. This is what I came up with: ...
Alain's user avatar
  • 27.4k
0 votes
1 answer
952 views

Related Articles: How do I build Expression Call for Any Method with generic parameter LINQ Expression Tree: Call Any method against a DbSet I'd like to be able to dynamically construct a where ...
Erik Philips's user avatar
  • 54.8k
3 votes
0 answers
122 views

The Expression tree which results from C# Expression Expression<Func<int, decimal>> f = (int i) => i + 1.0m ; has the correct Expression.Convert applied to the integer parameter i ...
QFirstLast's user avatar

1
2 3 4 5
13