I would suggest reading a list of methods of the Expression class , all of your parameters are listed here, and the Expression Tree Programming Guide .
Regarding this specific example:
var pX = Expression.Parameter(typeof(double?)); var body = Expression.Condition( Expression.Property(pX, "HasValue"), Expression.Call(typeof(BitConverter), "GetBytes", null, Expression.Member(pX, "Value")), Expression.Constant(new byte[] { 0xFF }) ); var lambda = Expression.Lambda<Func<double?,byte[]>>(body, pX); Func<double?,byte[]> compiled = lambda.Compile();
source share