Method ThrowIfNull
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
ThrowIfNull(object, string)
Throws an ArgumentNullException if the given argument is null.
public static void ThrowIfNull(this object argument, string argName)
Parameters
Exceptions
- ArgumentNullException
argumentis null.
ThrowIfNull<T>(T, string)
Throws an ArgumentNullException if the object is null.
public static T ThrowIfNull<T>(this T obj, string objArgName = null)
Parameters
objTThe object to check.
objArgNamestringThe name of the argument.
Returns
- T
The original object if it is not null.
Type Parameters
TThe type of the object.
Exceptions
- ArgumentNullException
objis null.