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

Expression Tree Tutorial - Knowledge Base (KB)

10 results in tag: func

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

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

"Incorrect number of parameters supplied for lambda declaration"

When I have this,...public static object Create() { return new object(); } ...this works:...var m = typeof(Class).GetMethod("Create"); var e = Expression.Call(m); Func<object> f = Expression.Lambda<Func<object>>(e).Compile(); ...But when I have this,....
c# expression expression-trees func
asked by nawfal

Call Func<> with argument of type object

I have (for instance) a ...Func<int, int>... which I want to call as usual, except that the parameter is of type ...object... rater than ...int.... I only know the exact type of the Func and the argument at runtime, because the Func was created using Expr...
c# expression-trees func
asked by user2037593

How do I create a generic Expression that has an expression as a parameter

There is a ...DisplayNameFor(x=>x.Title)... helper in ASP.Net MVC. I want to implement something similar in behavior....I want to have a method that accepts an expression based on ...User... class (...u=>u.Birthdate... or u=>u.Name), a operand (Greater, L...
c# expression-trees func lambda
asked by Alexander Taran

Getting parameters of Func<T> variable

I have a rather complicated issue. I am trying to get a unique key from a method and its formal and actual parameters. The goal of the method, is to take a method call, and return a unique key based on 1) The name of the class and method and 2) The name a...
c# dynamic expression-trees func lambda
asked by Erik A. Brandstadmoen

Get MemberInfo of child property from a MemberExpression

I am trying to get MemberInfo for a child property from a MemberExpression. I have found ways to get the full name of the nested type, but not a way to get the whole MemberInfo of the nested type. Here is a quick example of the scenario I am talking about...
c# expression-trees func lambda memberinfo
asked by Chris Knight

Making a lambda expression to call a method from a generic class

I have these simple interface:...public interface IQuery<TResult> { } public interface IQueryHandler<in TQuery, out TResult> where TQuery : IQuery<TResult> { TResult Handle(TQuery query); } ...And there are some implementation of them. I'm tryin...
c# c#-4.0 expression-trees func lambda
asked by ravy amiry

Optimizing Func.Invoke() generated from expression tree

I am working on an automation for instantiating classes dynamically....I decided to write an expression tree that would generate a ...Func..., that could instantiate my class for me. However, I am noticing 3x slower performance of my ...Func... as opposed...
c# expression-trees func performance
asked by Hentov

How to convent viewmodel to Expression<Func<T,bool>>?

Piggybacking off of a ...very similar question.........I need to generate an ...Expression... from a ...ViewModel... to pass as a search predicate for ...IQueryable.Where.... I need to be able to include/exclude query parameters based on what is provided ...
c# expression-trees func ienumerable iqueryable
asked by Sam

Page 1 of 1
  • 1

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!