The nested link can be accessed from cells 1

I created a Business and DataAccess Layer for my web project using dotnet core. I added a data access link in the business layer and referenced the business layer at the UI layer (web project).

I saw I can access my data access layer from my UI (web) project. I'm really wondering if this can break any application design.

Appreciate the help if anyone comes across this and how to restrict access to the data access layer from the user interface.

enter image description here

+3


source to share


1 answer


Yes, indirect dependency is addiction as well.

And your toplevel (MVC) project has to reference everything, direct or indirect, in order to load all modules. And set up dependency injection.



You can improve separation by introducing the interface layer into a separate project. For example IBusinessClass and IDataAccessClass.

This works for everything but the main project, so if you want this to be a separate branch from your example, move your controllers into a separate project and only depend on the IBusiness interfaces. Though I'm not sure how this works with MVC conventions.

0


source







All Articles