Fix 13.15 (CS8600), 13.18 (CS8603), 18.29 (CS8601)
MODIFY
src/Chapter13/Listing13.18.UsingVarianceForDelegates.cs
src/Chapter13/Listing13.18.UsingVarianceForDelegates.cs
@@ -17,9 +17,10 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter13.Listing13_18
Action<string> narrowAction = broadAction;
+ // TODO: Update Manuscript
// Covariance
Func<string> narrowFunction =
- () => Console.ReadLine();
+ () => 911.ToString();
Func<object> broadFunction = narrowFunction;

MODIFY
src/Chapter18/Listing18.29.ImplementingACustomDynamicObject.cs
src/Chapter18/Listing18.29.ImplementingACustomDynamicObject.cs
@@ -40,21 +40,22 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29
return success;
}
+ // TODO: Update listing in Manuscript
public override bool TrySetMember(
- SetMemberBinder binder, object value)
+ SetMemberBinder binder, object? value)
{
bool success = false;
XElement firstDescendant =
Element.Descendants(binder.Name).First();
if(firstDescendant != null)
{
- if(value.GetType() == typeof(XElement))
+ if(value?.GetType() == typeof(XElement))
{
firstDescendant.ReplaceWith(value);
}
else
{
- firstDescendant.Value = value.ToString();
+ firstDescendant.Value = value?.ToString() ?? string.Empty;
}
success = true;
}

Fix 13.15 (CS8600), 13.18 (CS8603), 18.29 (CS8601)