Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 1.74 KB

File metadata and controls

45 lines (27 loc) · 1.74 KB

dfc-coursedirectory - WebV2

Patterns in use

MediatR / CQRS

To achieve:

  • thin-controllers,
  • testability
  • separation of concerns
  • separation of testing from the aspnet infrastructure code

we are using MediatR.

For an intro to MediatR in controllers see:

OneOf

OneOf<> gives us better compile time checks for passing around one of multiple types. See the OneOf readme for further explanation.

Tests

There are no controller tests because the controller actions are very thin mappings.

The tests are mostly integration tests that test an endpoint + behaviour.

Multi-page transactions - FormFlow

To support stateful multi-page processes we are using the FormFlow nuget package.

Folder Structure

To keep things together that change together we are not using the traditional Views/Controllers folder structure. Instead we have Features/*/ folders that group together related functionality, including views, controllers and MediatR CQRS behaviour implementations.

Feature-per-file

We are not doing class-per-file. Feature behaviour is implemented in a single .cs file following the MediatR query/command/handler patterns.