nullex, nullempex, nullwex – Surviveplus Code Snippets

Surviveplus Code Snippets

Verify Args

Three code snippets for Visual Studio 2012 & 2013. It is used by Surviveplus.net developers team for Validating Arguments.

  • Throw Exception when argument is the empty string or a null reference [nullempex]
  • Throw Exception when argument is a null reference [nullex]
  • Throw Exception when argument is white-space, the empty string or a null reference [nullwex]

Inserting codes in C# (Movie)

Description

In Visual Studio Static Code Analysis, all reference arguments that are passed to externally visible methods should be checked against null.

CA1062: Validate arguments of public methods

Use these snippets, to insert validation logic easily.

C#Visual Basic

Throw Exception when argument is the empty string or a null reference [nullempex]

Throw Exception when argument is a null reference [nullex]

Throw Exception when argument is white-space, the empty string or a null reference [nullwex]

Throw Exception when argument is the empty string or a null reference [nullempex]

Throw Exception when argument is a null reference [nullex]

Throw Exception when argument is white-space, the empty string or a null reference [nullwex]

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 class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">