Skip to content

Class Result

Namespace: Cephalon.Abstractions.Behaviors
Assembly: Cephalon.Abstractions.dll

Provides concise factory helpers for creating transport-neutral behavior results.

public static class Result

objectResult

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Prefer this type for new behavior authoring code when the longer naming does not add clarity.

Creates an accepted result with a payload value.

public static Result<T> Accepted<T>(T value, string? message = null, string? code = null)

value T

message string?

code string?

Result<T>

T

Creates a conflict result.

public static BehaviorResultDescriptor Conflict(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

BehaviorResultDescriptor

Conflict<T>(string, string, BehaviorFault?)

Section titled “ Conflict<T>(string, string, BehaviorFault?)”

Creates a conflict result for the specified payload type.

public static Result<T> Conflict<T>(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

Result<T>

T

Creates a created result with a payload value.

public static Result<T> Created<T>(T value, string? message = null, string? code = null)

value T

message string?

code string?

Result<T>

T

Forbidden(string, string, BehaviorFault?)

Section titled “ Forbidden(string, string, BehaviorFault?)”

Creates a forbidden result.

public static BehaviorResultDescriptor Forbidden(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

BehaviorResultDescriptor

Forbidden<T>(string, string, BehaviorFault?)

Section titled “ Forbidden<T>(string, string, BehaviorFault?)”

Creates a forbidden result for the specified payload type.

public static Result<T> Forbidden<T>(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

Result<T>

T

Creates an invalid-request result.

public static BehaviorResultDescriptor Invalid(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

BehaviorResultDescriptor

Invalid<T>(string, string, BehaviorFault?)

Section titled “ Invalid<T>(string, string, BehaviorFault?)”

Creates an invalid-request result for the specified payload type.

public static Result<T> Invalid<T>(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

Result<T>

T

Creates a no-content result.

public static BehaviorResultDescriptor NoContent(string? message = null, string? code = null)

message string?

code string?

BehaviorResultDescriptor

Creates a no-content result for the specified payload type.

public static Result<T> NoContent<T>(string? message = null, string? code = null)

message string?

code string?

Result<T>

T

Creates a not-found result.

public static BehaviorResultDescriptor NotFound(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

BehaviorResultDescriptor

NotFound<T>(string, string, BehaviorFault?)

Section titled “ NotFound<T>(string, string, BehaviorFault?)”

Creates a not-found result for the specified payload type.

public static Result<T> NotFound<T>(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

Result<T>

T

Creates a successful result with a payload value.

public static Result<T> Ok<T>(T value, string? message = null, string? code = null)

value T

message string?

code string?

Result<T>

T

Unauthorized(string, string, BehaviorFault?)

Section titled “ Unauthorized(string, string, BehaviorFault?)”

Creates an unauthorized result.

public static BehaviorResultDescriptor Unauthorized(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

BehaviorResultDescriptor

Unauthorized<T>(string, string, BehaviorFault?)

Section titled “ Unauthorized<T>(string, string, BehaviorFault?)”

Creates an unauthorized result for the specified payload type.

public static Result<T> Unauthorized<T>(string code, string message, BehaviorFault? fault = null)

code string

message string

fault BehaviorFault?

Result<T>

T