I can arrange my code in assemblies to ensure the correct namespace dependency:
Company.Product.Domain assembly Company.Product.DataAccessLayer assembly -References Company.Product.Domain Company.Product.Application assembly -References Company.Product.Domain -References Company.Product.DataAccessLayer
Since the link to the circular assembly is not possible, I can be sure that I am not referring to the DAL from within the domain, for example.
But this leads to a large number of assemblies, when you have several domains, I would just use namespaces to organize the project as follows:
Company.Product assembly -Company.Product.Domain namespace -Company.Product.DataAccessLayer namespace -Company.Product.Application namespace
Is there any way to prevent or warn about namespace dependencies that I don't want.
I have a resharper if there is a "Code Check -> Custom Template" that someone knows about.
source share