Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

trhow exception if is null c#

public Exception GetException(object instance)
{
    return (instance == null) ? new ArgumentNullException() : new ArgumentException();
}

public void Main()
{
    object something = null;
    throw GetException(something);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #trhow #exception #null
ADD COMMENT
Topic
Name
2+5 =