You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear NilavPatel,
Thank you for this sample, But i think this solution need more separation of concerns, I will explain where and why.
Data and services both are in one project, This make it hard to refactor or changing technology for specific part, For example if i want to change my DBProvider from EFCore to MondoDb, I need to create new project for infrastructure which contain EmailService and LoggerService, These kind of code should be separated.
Application layer should only orchestrate whole application, It should contain any interface of any service, All interface and contracts should be in domain layer, But i suggest create domain layer as folder because domain layer should have more than one project.
Example :
MyApp.Domain.Data
MyApp.Domain.Service
MyApp.Domain.Shared
MyApp.Domain.Contract
Same thing should happen to infrastructure layer, It need to be a folder which contains :
MyApp.Infrastructure.DataEFCore
MyApp.Infrastructure.Service
(if you want to separate even better : MyApp.Infrastructure.LoggerService, MyApp.Infrastructure.EmailService)
If you do this, You be abble change your DBProvider easily by adding another project like MyApp.Infrastructure.DataMongoDb without implement your EmailService and LoggerService, You only need to call another dependency resolver in your WebApi project.
About MyApp.DbMigrations i have to say i didn't get why this project exists, This logic and code should be in MyApp.Infrastructure.DataEFCore project.
The whole solution could be something like this :
The text was updated successfully, but these errors were encountered:
Dear NilavPatel,
Thank you for this sample, But i think this solution need more separation of concerns, I will explain where and why.
Data and services both are in one project, This make it hard to refactor or changing technology for specific part, For example if i want to change my DBProvider from EFCore to MondoDb, I need to create new project for infrastructure which contain EmailService and LoggerService, These kind of code should be separated.
Application layer should only orchestrate whole application, It should contain any interface of any service, All interface and contracts should be in domain layer, But i suggest create domain layer as folder because domain layer should have more than one project.
Example :
MyApp.Domain.Data
MyApp.Domain.Service
MyApp.Domain.Shared
MyApp.Domain.Contract
Same thing should happen to infrastructure layer, It need to be a folder which contains :
MyApp.Infrastructure.DataEFCore
MyApp.Infrastructure.Service
(if you want to separate even better : MyApp.Infrastructure.LoggerService, MyApp.Infrastructure.EmailService)
If you do this, You be abble change your DBProvider easily by adding another project like MyApp.Infrastructure.DataMongoDb without implement your EmailService and LoggerService, You only need to call another dependency resolver in your WebApi project.
About MyApp.DbMigrations i have to say i didn't get why this project exists, This logic and code should be in MyApp.Infrastructure.DataEFCore project.
The whole solution could be something like this :
The text was updated successfully, but these errors were encountered: