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
Persistence (code-first, migrations, repository, unit of work)
Application (Command/Query segregation, Auto mapping, DTOs, fluent
validation, Result pattern)
API (exception middleware)
APPROACH
Create Persistence project (C# Class library)
a. Create folder Models and create the four database models from diagram
b. Create DBContext
Create Domain project (C# Class library)
a. Create folder Entities, then inside that OrderAggregate
b. In OrderAggregate, create Order and OrderLine classes
c. Create Product and Customer class (inside Entities folder)
d. Create ValueObjects folder and create Address class.
e. Create folder Interfaces, create folder Repository
f. Create repository interfaces
Create Application project (C# Class library)
a. Create folder Interfaces, create IUnitOfWork interface
Create UnitOfWork and Repositories in Persistence project
a. Use Automapper where possible
b. Use DbContextFactory and generics for accessing repositories
In Application project,
a. create Commands and Queries folders
b. Create command and query classes where applicable
c. Create DTO folder
d. Create DTO for return data where applicable (get order, get customer)
e. Create Result class
f. Create Interfaces folder
g. Create service interfaces
h. Implement services
i. Use Fluent validation
ii. Use UnitOfWork when using repositories for updates
iii. Set and return Result object
iv. Use Mapping to go from Domain to DTO’s
Create API project
a. Create Controller folder
i. Create controllers for endpoints
1. Use services
ii. Setup Program.cs
1. Setup database
2. Automatic migration
3. Dependency Injection
4. AutoMapper
b. Create Exception handling middleware