public static class GrpcPreconditions : object
Utility methods to simplify checking preconditions in the code.
Namespace
Grpc.Core.UtilsAssembly
Grpc.Core.Api.dll
Methods
CheckArgument(Boolean)
public static void CheckArgument(bool condition)
Throws if condition is false.
CheckArgument(Boolean, String)
public static void CheckArgument(bool condition, string errorMessage)
Throws with given message if condition is false.
CheckNotNull<T>(T)
public static T CheckNotNull<T>(T reference)
Throws if reference is null.
Parameter
Name
Description
reference
T
The reference.
Returns
Type
Description
T
Type Parameter
Name
Description
T
CheckNotNull<T>(T, String)
public static T CheckNotNull<T>(T reference, string paramName)
Throws if reference is null.
Returns
Type
Description
T
Type Parameter
Name
Description
T
CheckState(Boolean)
public static void CheckState(bool condition)
Throws if condition is false.
CheckState(Boolean, String)
public static void CheckState(bool condition, string errorMessage)
Throws with given message if condition is false.

