What's the equivalent to PropertyInfo.Reflecte

2019-07-25 20:58发布

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条回答
太酷不给撩
2楼-- · 2019-07-25 21:29

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).

查看更多
登录 后发表回答