I have fairly large API project. I want to rework it to be more clear and structured.
I never worked in large MVC projects, so i have fiew questions which i can’t figure out on my own:
- What exactly is service used for? Should I put all businnes logic into or just specific parts? Should Controller even have DbContext as direct dependency?
- How to handle errors? I am fighting the urge to make some “error-value” class that would be json serializable end never raise an exceptions to not have billions of ways to get 500 from my API (I was working in rust previously), but if feel that future maintainers will have hard time working with this mess