ThrowHelper.ThrowInvalidDataException Method

Definition

Overloads

ThrowInvalidDataException()

Throws a new InvalidDataException.

ThrowInvalidDataException(String)

Throws a new InvalidDataException.

ThrowInvalidDataException(String, Exception)

Throws a new InvalidDataException.

ThrowInvalidDataException<T>()

Throws a new InvalidDataException.

ThrowInvalidDataException<T>(String)

Throws a new InvalidDataException.

ThrowInvalidDataException<T>(String, Exception)

Throws a new InvalidDataException.

ThrowInvalidDataException()

Throws a new InvalidDataException.

public static void ThrowInvalidDataException ();
static member ThrowInvalidDataException : unit -> unit
Public Shared Sub ThrowInvalidDataException ()

Exceptions

Thrown with no parameters.

Applies to

ThrowInvalidDataException(String)

Throws a new InvalidDataException.

public static void ThrowInvalidDataException (string? message);
static member ThrowInvalidDataException : string -> unit
Public Shared Sub ThrowInvalidDataException (message As String)

Parameters

message
String

The message to include in the exception.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowInvalidDataException(String, Exception)

Throws a new InvalidDataException.

public static void ThrowInvalidDataException (string? message, Exception? innerException);
static member ThrowInvalidDataException : string * Exception -> unit
Public Shared Sub ThrowInvalidDataException (message As String, innerException As Exception)

Parameters

message
String

The message to include in the exception.

innerException
Exception

The inner Exception to include.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowInvalidDataException<T>()

Throws a new InvalidDataException.

public static T ThrowInvalidDataException<T> ();
static member ThrowInvalidDataException : unit -> 'T
Public Shared Function ThrowInvalidDataException(Of T) () As T

Type Parameters

T

The type of expected result.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with no parameters.

Applies to

ThrowInvalidDataException<T>(String)

Throws a new InvalidDataException.

public static T ThrowInvalidDataException<T> (string? message);
static member ThrowInvalidDataException : string -> 'T
Public Shared Function ThrowInvalidDataException(Of T) (message As String) As T

Type Parameters

T

The type of expected result.

Parameters

message
String

The message to include in the exception.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowInvalidDataException<T>(String, Exception)

Throws a new InvalidDataException.

public static T ThrowInvalidDataException<T> (string? message, Exception? innerException);
static member ThrowInvalidDataException : string * Exception -> 'T
Public Shared Function ThrowInvalidDataException(Of T) (message As String, innerException As Exception) As T

Type Parameters

T

The type of expected result.

Parameters

message
String

The message to include in the exception.

innerException
Exception

The inner Exception to include.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameter.

Applies to