What is the equivalent of PropertyInfo.ReflectedType in .NET Core / .NET Standard?

I need something like what PropertyInfo.ReflectedType

does in a complete framework.

So far I haven't been able to figure out what the alternative to the whole property might be PropertyInfo

.

+1


source to share


1 answer


ReflectedType is not supported in .NET Core and has been "deliberately deprecated" as the folks at Microsoft say. This question on github contains a blog link that explains the reason, but is breaking now ...



You can look at PR for example Nunit. Eliminate the use of ReflectedType when preparing to support ASP.NET 5 or AutoFixture. CoreCLR support to get ideas for customizing your code. In general, a working solution is to remove all use of the property ReflectedType

and instead hold and use a reference to the object for which the type was obtained (the reflected object).

+1


source







All Articles