I'm struggling with the idea of how to build an expression tree for more lambdas such as the one below, let alone something that might have multiple statements. For example:
Func<double?, byte[]> GetBytes
= x => x.HasValue ? BitConverter.GetBytes(x.Value) : new byte[1] { 0xFF };
I would appreciate any thoughts.
I would suggest reading through the list of methods on the Expression class, all of your options are listed there, and the Expression Trees Programming Guide.
As for this particular instance: