How can I emulate Expression.Default
(new in .NET 4.0) in 3.5?
Do I need to manually check the expression type and use different code for reference and value types?
This is what I'm currently doing, is there a better way?
Expression GetDefaultExpression(Type type)
{
if (type.IsValueType)
return Expression.New(type);
return Expression.Constant(null, type);
}