ThrowHelper.ThrowInvalidDataException Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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
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
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.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.