Class GrpcPreconditions (2.63.0)

 public static class GrpcPreconditions 

Utility methods to simplify checking preconditions in the code.

Inheritance

object > GrpcPreconditions

Namespace

Grpc.Core.Utils

Assembly

Grpc.Core.Api.dll

Methods

CheckArgument(bool)

 public static void CheckArgument(bool condition) 

Throws ArgumentException if condition is false.

Parameter
Name
Description
condition
bool

The condition.

CheckArgument(bool, string)

 public static void CheckArgument(bool condition, string errorMessage) 

Throws ArgumentException with given message if condition is false.

Parameters
Name
Description
condition
bool

The condition.

errorMessage
string

The error message.

CheckNotNull<T>(T)

 public static T CheckNotNull<T>(T reference) 

Throws ArgumentNullException 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 ArgumentNullException if reference is null.

Parameters
Name
Description
reference
T

The reference.

paramName
string

The parameter name.

Returns
Type
Description
T
Type Parameter
Name
Description
T

CheckState(bool)

 public static void CheckState(bool condition) 

Throws InvalidOperationException if condition is false.

Parameter
Name
Description
condition
bool

The condition.

CheckState(bool, string)

 public static void CheckState(bool condition, string errorMessage) 

Throws InvalidOperationException with given message if condition is false.

Parameters
Name
Description
condition
bool

The condition.

errorMessage
string

The error message.

Create a Mobile Website
View Site in Mobile | Classic
Share by: