I am trying to implement basic UoW/Repository pattern with ASP.NET/Entity Framework Core and I have encountered very troubling behavior.
My solution consists of 4 pro
That is intended behavior. It is called meta-packages and used for example for the NETStandard.Library
package to include all libraries of the base class library. I do not think there is a way hiding them.
I've been struggling with this for months and finally found a way to disable the transitive references of projects in Core.
In the .csproj file for .Facade.EF, you can add PrivateAssets="All"
to the ProjectReference to .DAL:
<ItemGroup>
<ProjectReference Include="..\.DAL\.DAL.csproj" PrivateAssets="All" />
</ItemGroup>
With this setting, projects that reference .Facade.EF no longer reference .DAL too.
In more abstract terms, if you want A to reference B and B to reference C, but don't want A to reference C, add this:
In B.csproj
<ItemGroup>
<ProjectReference Include="..\C\C.csproj" PrivateAssets="All" />
</ItemGroup>
Source: https://github.com/dotnet/project-system/issues/2313