I have nullable reference types turned on and I have the following block of code:
ExpandoObject? e1 = null;
ExpandoObject e2 = null;
ExpandoObject e3 = new();
var d1 = (IDictionary<string, object>)e1;
var d2 = (IDictionary<string, object>)e2;
var d3 = (IDictionary<string, object>)e3;
I'm trying to cast the expando object to a dictionary but each cast gives me the following warning:
Warning CS8619 Nullability of reference types in value of type 'ExpandoObject' doesn't match target type 'IDictionary<string, object>'.
How can I suppress this warning?