C# has a mechanism for user to define an implicit conversion from one type to another i.e. usually (since types are validated by the compiler) given two unrelated user-defined types T1
and T2
the following T1 x = new T2();
will result in compiler error, but with implicit conversion defined compiler will use it and this code will work. See more in user-defined explicit and implicit conversion operators doc.
context.Response.Headers
is a IHeaderDictionary
which has an indexer property of type StringValues
which has an implicit conversion from string
. The implicit conversion is defined like this:
public static implicit operator StringValues(string? value)
{
return new StringValues(value);
}
Implicit conversions sometimes can be tricky (for example) so it seems that Rider team decided that it worth to notify user in some way when one is happening.