MavierTechCompany / CookieBook-WebAPI

A WebAPI for Cookie Book project.
Other
1 stars 0 forks source link

Better service internal assertions #43

Closed MadTiger2409 closed 3 years ago

MadTiger2409 commented 4 years ago

Needs to improve the design of the if (...) throw ... statements.

I can for example move this to some extension methods or create a static class like "user assertions" that will be able to execute some validation (for example "CanLogIn"),

Now it looks like this: obraz.png

MadTiger2409 commented 4 years ago

Should read this: https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions

MadTiger2409 commented 3 years ago

Won't do. Doesn't have resources/time for future improvements, but it's nice to have this in mind when working on next project.