I Have 3 projects in same solution, each dependent from the one before (DB <- Provider <- WinUI). In DB I defined a Behaviour class that will be used in Providers with a mapper Behavioud class, this last used by WinUI project. (WinUI doesn't depend directly from DB).
Is there a way to hide the clases from DB inside WinUI? this project only should use the provider clases.
First, mark the Behaviour
class in the DB project as internal
.
Second, add
[assembly: InternalsVisibleTo("Providers")]
<ItemGroup>
<InternalsVisibleTo Include="Providers" />
</ItemGroup>
internal
prevents the class from being visible in other assemblies. The assembly attribute allows sharing internal classes with the assemblies you name.