Is there a tool to automatically create wrappers around classes?

I would like to access some inner classes of the .NET Framework, but using reflection is not very readable and useful to use.

Does anyone know if there is a tool to create wrapper classes automatically around these inner classes?

+3
source share
1 answer

Well, Visual Studio can create wrappers around your own classes for unit testing purposes. This is called shadow classes or shadow assemblies. This can be used to do the same for framework classes.

There are several steps:

framework.accessor, , , ( ). :

System.dll

.csproj :

<ItemGroup>
    <Shadow Include="framework.accessor" />
</ItemGroup>

. , * _Accessor.

( ).

, - , , .

+3

Source: https://habr.com/ru/post/1712124/


All Articles