zzz projects Expression Tree Tutorial
Getting Started Documentation Knowledge Base
  • Getting Started
  • Documentation
  • Knowledge Base

Expression Tree Tutorial - Knowledge Base (KB)

656 results for:

Building dynamic lambda expressions

I know how to build a simple lambda like ...x => x > 5...:...int[] nbs = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; IEnumerable<int> result1 = nbs.Where(x => x > 5); ParameterExpression parameter = Expression.Parameter(typeof(int), "x"); Consta...
dynamic expression expression-trees lambda tree
asked by Andy Rehn

Building dynamic lambda expression

I know how to build a simple lambda like ...x => x > 5...:...int[] nbs = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; IEnumerable<int> result1 = nbs.Where(x => x > 5); ParameterExpression parameter = Expression.Parameter(typeof(int), "x"); Consta...
dynamic expression expression-trees lambda tree
asked by Andy Rehn

Building lambda expression dynamically

I know how to build a simple lambda like x => x > 5:...int[] nbs = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; IEnumerable<int> result1 = nbs.Where(x => x > 5); ParameterExpression parameter = Expression.Parameter(typeof(int), "x"); ConstantExpr...
dynamic expression expression-trees lambda tree
asked by Andy Rehn

DateTime lambda expressions

I was testing the implementation in the thread answer ...https://stackoverflow.com/a/7891426/1468492... but I get an error trying to parse an expression with a ...DateTime..., for instance: ...t => t.Name == "NAME" && t.OpeningDate == DateTime.Now.... ...
c# expression expression-trees lambda linq-expressions
asked by Ernesto Rodriguez

Write Dynamic LINQ queries for sorting and projecting with EF Core

I am having troubles trying to get valid expressions for "inner graph" members....I wrote several code lines based on previous stack overflow answers. but I have issues finding a good "solution approach"....For example trying to express "a string" as a la...
c# entity-framework entity-framework-core expression-trees linq
asked by alhpe

How to extract a where clause expression tree from IQueryable

I need to add an "Or" clause in a where clause dynamically, depending on some conditions to an existing IQueryable object. ...Using ExpressionBuilder, I can compose a left and right Expression> but for that to wrok, I need to extract the Expression> from ...
entity-framework-6 expression-trees lambda linq
asked by Stéphan

Text query parsing in Sprache

I'm trying to write some code to match strings based on a pattern:...pattern: "dog and (cat or goat)" ...test string: "doggoat" result: true...test string: "dogfrog" result: false...I'm trying to write a parser using Sprache, with most of the logic provid...
c# dynamic-linq expression-trees linq-expressions sprache
asked by Alan Sage

Accessing expression bodied members to build expression trees

Trying to build an order by expression using expression trees. But I am unable to access an expression bodied property of the query result's class. This is the class structure:...public class AssetFileRecord : IAuditable, IEntity, INavigateToCustomValues ...
c# entity-framework-6 expression-trees linq
asked by Abhay Nagaraj

Entity Framework Core- Use Expression Tree With Interface As Parameter

I will really appreciate some help with following scenario. I have the following classes:...public class Product : IHasPrice { public string Title { get; set; } public int Price { get; set; } public string CustomerId { get; set; } } public i...
c# entity-framework entity-framework-core expression-trees
asked by Tal Humy

System.Linq.Dynamic.DynamicExpression parsing expressions with enum parameters

I am trying to parse a LambdaExpression Tree using DynamicExpression.ParseLambda but I cannot get it to correctly parse when using string.Equals with the StringComparison enum....I have tried:...a) using StringComparison but I get the error 'Unknown ident...
c# dynamic-linq expression-trees linq
asked by Rossimac

EF Core SQL Function LIKE Method with Linq Expression not working for Non String types

am able to create an invoke Expression with SQL Functions like as shown below...var likeMethod = typeof(DbFunctionsExtensions).GetMethod("Like", new[] { typeof(DbFunctions), typeof(string), typeof(string) }); Expression.Call(null, likeMethod, Expression....
c# ef-core-2.1 entity-framework-core expression-trees
asked by Akshay Joy

Re-implementation of OrderBy, ThenBy and Null TypeMapping in Sql Tree error

I am trying to implement ...OrderBy... and ...ThenBy... in a different way to hide lambda expression from ...OrderBy... and ...ThenBy... extension methods. These extension methods accept classes which implement ...IOrderSpecification...: ...public class P...
c# entity-framework-core expression-trees lambda linq
asked by peyman gilmour

Complex edit of a body Expression<Func<T,bool>>

Summary:... I want to know how can I detect specific definitions from the expression's body then change it in the way I want, such as ...e.Entity.ListA.Union(e.ListB).Any(...)... ...To...e.Entity != null && ((e.Entity.ListA != null && e.Entity.ListA.Any(...
c# entity-framework entity-framework-core expression-trees linq
asked by AbuDawood

Correct Collection in ConstantExpression for EF Core

I try to realize my own Expression serializator/deserializator for passing it through services (I want to realize my own endpoint for EF Core service). So, now I have problem with Collections in LambdaExpressions. For example,...var dataQuery = testDb.Use...
.net-core c# entity-framework-core expression-trees linq
asked by Dmitriy

Conditionally ignore fields with LINQ select

I've been unable to find any examples where you can conditionally exclude fields based off a variable within a select projection in LINQ, see also ...LINQ: Select an object and change some properties without creating a new object.......Let me give some ba...
dynamic-linq entity-framework-core expression-trees linq linqkit
asked by Mark G

Entity Framework Core LINQ Tree Expression Problem with Concat

So I have a IQueryable extension that does a little more than this block of code. Essentially I'm combining of bunch of strings and afterwards doing a Contains on them. The problem I'm running into is that Entity Framework Core doesn't support System.Stri...
.net-core c# entity-framework-core expression-trees
asked by Richard Cawthon

Page 33 of 33
  • ««
  • «
  • …
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...