C# Class Google.Protobuf.ProtoPreconditions

Helper methods for throwing exceptions when preconditions are not met.
This class is used internally and by generated code; it is not particularly expected to be used from application code, although nothing prevents it from being used that way.
Datei anzeigen Open project: yimengfan/BDFramework.Core Class Usage Examples

Public Methods

Method Description
CheckNotNull ( value, string name ) : T

Throws an ArgumentNullException if the given value is null, otherwise return the value to the caller.

Private Methods

Method Description
CheckNotNullUnconstrained ( value, string name ) : T

Throws an ArgumentNullException if the given value is null, otherwise return the value to the caller.

This is equivalent to CheckNotNull{T}(T, string) but without the type parameter constraint. In most cases, the constraint is useful to prevent you from calling CheckNotNull with a value type - but it gets in the way if either you want to use it with a nullable value type, or you want to use it with an unconstrained type parameter.

Method Details

CheckNotNull() public static method

Throws an ArgumentNullException if the given value is null, otherwise return the value to the caller.
public static CheckNotNull ( value, string name ) : T
name string
return T