ArgumentNullException vs ArgumentException

Both ArgumentNullException and ArgumentException have a constructor which takes two strings.  One is the name of the parameter (or argument) in question and the other is a string describing the exception.

The funny/odd/interesting thing about them is that one has the opposite order of arguments.

For ArgumentException the constructor is:

public ArgumentException(
    string message,
    string paramName
)

While for ArgumentNullException is it:

public ArgumentNullException(
    string paramName,
    string message
)

And my point is….

Well, I don’t have one I just thought it was an interesting thing to point out :)

This entry was posted in C#. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>