Skip to main content

CkMethodResult

Namespace: Meshmakers.Octo.Sdk.ServiceClient.AssetRepositoryServices.Tenants.Methods

The outcome of a CK method call through a generated method client: either a success with the invocation id, or one of the errors the method declares in its CK model. Every other failure (authorization, validation, timeout, transport) is thrown, see CkMethodCallException.

public class CkMethodResult

Inheritance Object → CkMethodResult

Properties​

IsSuccess​

true when the method ran successfully.

public bool IsSuccess { get; }

Property Value​

Boolean

InvocationId​

The invocation id of a successful call, for correlation with the handler log; null for a failure.

public string InvocationId { get; }

Property Value​

String

Error​

The declared error of a failed call; null for a success.

public CkMethodError Error { get; }

Property Value​

CkMethodError

Methods​

IsError(String)​

true when the call failed with the declared error code.

public bool IsError(string code)

Parameters​

code String
A declared error code, e.g. a constant of the generated …Errors class

Returns​

Boolean

Success(String)​

A successful call of a method without result.

public static CkMethodResult Success(string invocationId)

Parameters​

invocationId String
The invocation id

Returns​

CkMethodResult

Failure(CkMethodError)​

A call that failed with a declared error.

public static CkMethodResult Failure(CkMethodError error)

Parameters​

error CkMethodError
The declared error

Returns​

CkMethodResult