DEV Community

Discussion on: From TDD to DDD: Building a .NET Core Web API - Part 1

Collapse
 
wariored profile image
Cheikh Tidjane Konteye

This is not really a DDD architecture. And it's better to have 3 layers (3 projects) for your API:

  • projectName.Api (Application Layer)
  • projectName.Domain (Domain Model Layer)
  • projectName.Infrastructure (Infrastructure Layer).

Then create a test project for each of your layer. For instance:

  • projectName.Api.Tests
  • projectName.Domain.Tests
  • projectName.Infrastructure.Tests

By doing so, you can use your Domain for another projects. The Domain Layer is responsible for representing concepts of the business, information about the business situation, and business rules. It's independent to other Layers