What's the equivalent to PropertyInfo.ReflectedType in .NET Core / .NET Standard?

怎甘沉沦 提交于 2019-12-11 07:28:31

问题


I need something like what PropertyInfo.ReflectedType does in the full framework.

For now I've been not able to figure out what can be the alternative to the whole property of PropertyInfo.


回答1:


ReflectedType is not supported in .NET Core and was "intentionally excluded" as guys from Microsoft says. This question on github contains a link to blog that explains the reason but is broken right now...

You may look on PRs like Nunit. Eliminate use of ReflectedType in preparation for ASP .Net 5 support or AutoFixture. Support for CoreCLR to get ideas how to adapt your code. In general, the working solution is to remove all using of ReflectedType property and instead hold and use the reference to the the object for which the type was got (reflected object).



来源:https://stackoverflow.com/questions/42126798/whats-the-equivalent-to-propertyinfo-reflectedtype-in-net-core-net-standard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!