Pattern is the same. Although with DI this will fail before calling constructor.
What is the correct way to fail in a WebApi Controller constructor
-
10-03-2022 - |
Pregunta
I have a WebApi Controller that requires a service via it's constructor. If this service is null I would usually throw a NullArguementException
. Is this still the correct way to fail in the context of a WebApi Controller or is there a different pattern for this.
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow