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

Expression Tree Tutorial - Knowledge Base (KB)

56 results in tag: expression

Expression. Alternatively, the argument 'item' is out of scope.

I am trying to write a static function to Or two expressions, but recieve the following error:...The parameter 'item' is not in scope....Description: An unhandled exception occurred during the execution of the current web request. Please review the ...
c# expression expression-trees linq
asked by ccook

I'm curious in the Expression Tree in.NET.

I have read several articles and several ...stackoverflow.com... posts about expression tree. It is beating my brain to understand....Questions:... 1) Like DOM (Document Object Model), it is an in-memory representation of logic?...2) Somebody explained it...
c# expression expression-trees
asked by user192142

When constructing expressions in C#, an item with the same key has already been inserted.

Ok, here's a tricky one. Hopefully there is an expression guru here who can spot what I am doing wrong here, cause I am just not getting it....I am building up expressions that I use to filter queries. To ease that process I have a couple of ...Expression...
c# exception expression expression-trees lambda
asked by Svish

Create a new expression from an existing one

I have an ...Expression<Func<T,DateTime>>... I want to take the DateTime part of the expression and pull the Month off of it. So I would be turning it into a ...Expression<Func<T,int>>... I'm not really sure how to do this. I looked at the ...ExpressionTr...
.net c# expression expression-trees lambda
asked by Adam

Using Lambda Expressions to Call a Generic Method (and a Type only known at runtime)

You can use ...Lambda Expression Objects... to represent a lambda as an expression....How do you create a ...Lambda Expression Object... representing a generic method call, if you only know the type -that you use for the generic method signature- at runt...
c# expression expression-trees generics lambda
asked by SDReyes

Why is Func> declared directly slower than Func> produced from ExpressionFunc>>?

Why is a ...Func<>... created from an ...Expression<Func<>>... via .Compile() considerably slower than just using a ...Func<>... declared directly ?...I just changed from using a ...Func<IInterface, object>... declared directly to one created from an ...E...
c# delegates expression expression-trees func
asked by MartinF

Linq to SQL Expression to Expression Tree Conversion

Can anyone convert this simple LINQ-to-SQL to an Expression Tree:...List<Region> lst = (from r in dc.Regions where r.RegionID > 2 && r.RegionDescription.Contains("ern") select r).ToList();
c#-4.0 expression expression-trees linq-to-sql
asked by Arian

to string expression

How can I get a string like...Namespace.IMyService.Do("1") ...from the expression as demoed in this snip it:...IMyService myService = ...; int param1 = 1; myExpressionService.Get(c => myService.Do(param1)); ...I actually don't want to call ...Do... unles...
c# expression expression-trees
asked by Daniel A. White

Query manipulation in the EntityFramework, database provider wrapping, and database expression trees

I'm trying to implement data localization logic for Entity Framework. So that if for example a query selects ...Title... property, behind the scenes it should reference the column ...Title_enGB... or ...Title_deCH... depending on the current user culture ...
c# entity-framework-4 expression expression-trees localization
asked by benwasd

How can I determine the type of a property in a generic expression?

public static void Map<T>(Expression<Func<T, object >> expression) { var memberExpression = (expression.Body as UnaryExpression).Operand as MemberExpression; var name = memberExpression.Member.Name; } ...Usage:...Map<Article>(x => x.Name) ...Name....
c# expression expression-trees generics
asked by Rookian

For the return type 'System.Object,' an expression of type 'System.DateTime' cannot be used.

I've created an expression that I'm using for sorting which works fine, until I hit a ...DateTime... field, where I get the following error (on the second line):...Expression of type 'System.DateTime' cannot be used for return type 'System.Object'...Her...
c# expression expression-trees linq
asked by Wildcat

parameter wcf ExpressionT>

I am trying to do something similar to using a lambda query inside a WCF operation parameter. I know there is no way to achieve this as lambda expressions are run-time and they can not be used in this way, but I think there are some solutions for this. My...
expression expression-trees parameters wcf
asked by Rati_Ge

Create a string expression (null reference)

Here is the problem:...We use table object to allow the users to perform some functionality like search, sort, pagination etc. Those tables works great. But there is a problem with one of the functionality : The sort (=OrderBy)....In fact, to allow the so...
c# expression expression-trees generics sql-order-by
asked by Whoami

Use string instead. In Expression, compare(a, b)

I've been teaching myself ...Expression Trees... since yesterday and I'm having problems comparing two string values. I've made this test case that fails with the error:...No method 'Compare' on type 'System.String' is compatible with the supplied argume...
c# expression expression-trees
asked by Chuck Savage

Creating MemberAcces with ExpressionTree to a complex type

I'd like to dynamically create a MemberAcess Expression to a deeper level then 1 (recursively):...public class Job { public string Name { get; set; } public int Salary { get; set; } } public class Employee { public string Name { get; set; } ...
c# expression expression-trees lambda linq
asked by Adam Tal

Expression tree for a member access of depth > 1

public class Job { public string Name { get; set; } public int Salary { get; set; } } public class Employee { public string Name { get; set; } public Job Job { get; set; } } ...If I want to create an expression tree of a member access to E...
c# expression expression-trees lambda linq
asked by Adam Tal

How can I Create a Expression.Property of a child object

normally I create an expresion in this way....ParameterExpression pe = Expression.Parameter(typeof(object1), "x"); string Name = "property1"; MemberExpression left = Expression.Property(pe, (object1).GetProperty(Name)); ...it produces ...left = x => x.p...
c# expression expression-trees func linq
asked by Diana G

Generic method to calculate Euclidean Distance using expressions

I'd like a method that can calculate the Euclidean distance using expressions and order an IQueryable:...sqrt[(q1 - p1)^2 + (q2 - p2)^2 + ... + (qn - pn)^2]...This is the method signature I've come up with:...public static IOrderedQueryable<T> EuclideanDi...
c# expression expression-trees linq
asked by cofiem

Expression to create an instance with object initializer

Is there any way to create an instance of an object with object initializer with an Expression Tree? I mean create an Expression Tree to build this lambda:...// my class public class MyObject { public bool DisplayValue { get; set; } } // my lambda: v...
c# dynamic expression expression-trees lambda
asked by agent47

Create array of all ExpressionTree/Func-parameters

Output of the following program is:...First: System.String. Second: System.String....The expected result is: First: hello1. Second: hello2....If i hardcode the index to 1 or 2 in Expression.Assign(resultArrayAccessor, parameters[0]) it works, but i need ...
c# expression expression-trees lambda
asked by Lars Stenberg

Page 1 of 3
  • 1
  • 2
  • 3
  • ยป

Prime Library

Performance

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

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!