throw a custom exception c sharp code example
Example: c# throw new exception
static void CopyObject(SampleClass original)
{
if (original == null)
{
throw new System.ArgumentException("Parameter cannot be null", "original");
}
}