문제

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.

도움이 되었습니까?

해결책

Pattern is the same. Although with DI this will fail before calling constructor.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top