Getting Started With Guard Clauses | NimblePros Blog

PHOTO EMBED

Sat Apr 23 2022 00:14:16 GMT+0000 (Coordinated Universal Time)

Saved by @iamsingularity #csharp

public class TestService
{
    private IService1 Service1;
    private IService2 Service2;

    public TestService(IService1 service1, IService2 service2)
    {
        Service1 = Guard.Against.Null(service1, nameof(service1));
        Service2 = Guard.Against.Null(service2, nameof(service2));
    }
}
content_copyCOPY

https://blog.nimblepros.com/blogs/getting-started-with-guard-clauses/