u/desmaraispin r/dotnet • Recommends
On “Refactoring a Monolithic .NET project as a Noob team ”
In my experience, those kinds of refactors work better when you do things in small pieces ( two minutes to better code )
Start with small changes. Lint your code. Remove unused deps. Delete code comments (yes, all of them). Remove unrefenced methods. Commit often. Very often.
Once you've worked through the easy stuff, start extracting services from your controllers. A couple of notes here.
- When you create those services, don't return your ef entities, that never ends well imo. Create some dtos.
- Once again, small changes. Don't create your service, dto and update your controllers all at once, that's bound to overwhelm you. Start with declaring your models, the your interfaces, then…