public static class GrpcPreconditions
Utility methods to simplify checking preconditions in the code.
Namespace
Grpc.Core.UtilsAssembly
Grpc.Core.Api.dll
Methods
CheckArgument(bool)
public static void CheckArgument(bool condition)
Throws ArgumentException if condition is false.
CheckArgument(bool, string)
public static void CheckArgument(bool condition, string errorMessage)
Throws ArgumentException with given message if condition is false.
CheckNotNull<T>(T)
public static T CheckNotNull<T>(T reference)
Throws ArgumentNullException if reference is null.
reference
T
The reference.
T
T
CheckNotNull<T>(T, string)
public static T CheckNotNull<T>(T reference, string paramName)
Throws ArgumentNullException if reference is null.
T
T
CheckState(bool)
public static void CheckState(bool condition)
Throws InvalidOperationException if condition is false.
CheckState(bool, string)
public static void CheckState(bool condition, string errorMessage)
Throws InvalidOperationException with given message if condition is false.

