This project has moved and is read-only. For the latest updates, please go here.

Serializable Linq Expressions

Remote Linq allows to translate System.Linq.Expressions.Expression trees (Linq Expression) into a serializable expression trees (Remote Linq Expression). Converting Linq Expressions into Remote Linq Expressions and vice versa is as simple as calling ToLinqExpression and ToRemoteLinqExpression.


// create linq expression
System.Linq.Expressions.Expression<Func<Order, bool>> linqExpression =
  order => order.Items.Where(i => i.ProductId == prodId).Sum(i => i.Quantity) > 1;

// transform linq expression into serializable expression tree
Remote.Linq.Expressions.LambdaExpression serializableExpression =

// transform serializable expression tree back into linq expression
System.Linq.Expressions.Expression<Func<Order, bool>> recreatedLinqExpression =
  serializableExpression.ToLinqExpression<Order, bool>();

Last edited Sep 11, 2014 at 10:14 PM by ChristofSenn, version 3