- use nsdepcop instead of project dependencies for layering so you can keep things in the same project
- generic action result in controllers instead of base type
- explicitly register your controllers rather than letting Controller Activator use them
- ditch your IOC container entirely
- use ValueOf for ids instead of ints
- hard code all non-secret config values each environment in your source code (using code, not json) and choose the right one based off a single 'env' variable
- use OneOf instead of custom Result objects/ Exceptions for control flow
- partition by feature vertical, not layer
- use delegates for your ports/adapters
- isolate your domain and use composition root
- move controllers into another project
- make all setters on domain internal
- make all domain manipulations work via public methods
- use Harden to expose which operations are available to the UI
- break all your services/repos into individual command/query objects
- use ValueTuples for DTOS using ValueOf and custom JSON.NET serialization
- if you are going to use swagger, use compile time nswag generation
- use database schemas and isolated db users to partition your database
- write gherkin inline in your unit tests
- favour stateless static methods for Domain Services
- favour testing from the outside
- test against classes using virtual properties instead of creating interfaces
- use timeouts of different durations so you can tell which thing is timing out :)
- log every incoming command so you can do command sourcing later if you want to, even if you don't see a need now
- start with large aggregrates and break them up when you NEED to
Last active
April 11, 2018 15:54
Star
You must be signed in to star a gist
ways to improve your c# code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment