KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why the following code throws an exception at runtime, whereas doing it in the traditional way compiles without problem? var left = Expression.Constant(25d); var right = Expression.Constant(20); // Throws an InvalidOperationException! var multiplyExpression = Expression.Multiply(left, right); var multiply = 25d * 20; Debug.WriteLine(multiply.ToString()); // Works normally! I won't use Expression.Convert since I can't determine exactly which expression should be converted.
Tags (comma-separated)
Save Edits
Cancel