This PR allows the construction of a closed generic type IJsonFormatter<T>
from a JsonFormatterAttribute on a property of a generic type,
where the property type is a generic parameter, and the
IJsonFormatter<T> is an open generic type.
Consider
public class Foo<T>
{
public T Bar { get; set; }
}
We may wish to define an IJsonFormatter<T> for property Bar. This
commit allows the following
public class Foo<T>
{
[JsonFormatter(typeof(BarFormatter<>)]
public T Bar { get; set; }
}
without needing to introduce a formatter for Foo<T>
This PR allows the construction of a closed generic type
IJsonFormatter<T>
from aJsonFormatterAttribute
on a property of a generic type, where the property type is a generic parameter, and theIJsonFormatter<T>
is an open generic type.Consider
We may wish to define an
IJsonFormatter<T>
for propertyBar
. This commit allows the followingwithout needing to introduce a formatter for
Foo<T>