The summarize example would be (Taking User entity as example) -
ProjectName -> ProjectName.API -> Controllers -> User -> UserController.cs UserStatisticsReport.cs ProjectName.Model -> User -> User.cs ProjectName.Business -> User -> UserLogic.cs ProjectName.Data -> DataLayer.cs IRepository.cs User -> UserRepository.cs
ProjectName -> ProjectName.API -> Controllers -> User -> UserController.cs UserStatisticsReport.cs ProjectName.Model -> User -> User.cs ProjectName.Business -> User -> UserLogic.cs ProjectName.Data -> DataLayer.cs IRepository.cs User -> UserRepository.cs
*If the logic class gets too big we break it down to CQRS classes.
Following the convention above how would you avoid explicitly writing namespaces between the Model layer and the Business layer? For example, you have this namespace in your Model layer -
ProjectName.Models.User
ProjectName.Models.User
With a class called -
User.cs
User.cs
. And this namespace in your Logic layer -
ProjectName.Logic.User
ProjectName.Logic.User
with a class called -
UserLogic.cs
UserLogic.cs
. You can't use
User.cs
User.cs
in
UserLogic.cs
UserLogic.cs
without specifying its entire namespace as User is part of the Logic namespace