Argument Checking and Guard Clauses

suggest change

Prefer

public class Order
{
    public OrderLine AddOrderLine(OrderLine orderLine)
    {
        if (orderLine == null) throw new ArgumentNullException(nameof(orderLine));
        ...
    }
}

Over

public class Order
{
    public OrderLine AddOrderLine(OrderLine orderLine)
    {
        if (orderLine == null) throw new ArgumentNullException("orderLine");
        ...
    }
}

Using the nameof feature makes it easier to refactor method parameters.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents