Misc. Changes that are in manuscript
MODIFY
src/Chapter13/Listing13.25.ExamingingAnExpressionTree.cs
src/Chapter13/Listing13.25.ExamingingAnExpressionTree.cs
{
using System;
using System.Linq.Expressions;
+ using static System.Linq.Expressions.ExpressionType;
public class Program
{
private static string NodeToString(Expression expression) =>
expression.NodeType switch
{
- ExpressionType.Multiply => "*",
- ExpressionType.Add => "+",
- ExpressionType.Divide => "/",
- ExpressionType.Subtract => "-",
- ExpressionType.GreaterThan => ">",
- ExpressionType.LessThan => "<",
+ // using static ExpressionType
+ Multiply => "*",
+ Add => "+",
+ Divide => "/",
+ Subtract => "-",
+ GreaterThan => ">",
+ LessThan => "<",
_ => expression.ToString() +
" (" + expression.NodeType.ToString() + ")",
};

MODIFY
src/Chapter14/Listing14.10.HandlingExceptionsFromSubscribers.cs
src/Chapter14/Listing14.10.HandlingExceptionsFromSubscribers.cs
List<Exception> exceptionCollection =
new List<Exception>();
foreach(
- Action<float> handler in
+ Delegate handler in
onTemperatureChange.GetInvocationList())
{
try
{
- handler(value);
+ ((Action<float>)handler)(value);
}
catch(Exception exception)
{

Misc. Changes that are in manuscript