Class Result
เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน
Namespace: Cephalon.Abstractions.Behaviors
Assembly: Cephalon.Abstractions.dll
Provides concise factory helpers for creating transport-neutral behavior results.
public static class ResultInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
Section titled “Remarks”Prefer this type for new behavior authoring code when the longer
Methods
Section titled “Methods”Accepted<T>(T, string?, string?)
Section titled “ Accepted<T>(T, string?, string?)”Creates an accepted result with a payload value.
public static Result<T> Accepted<T>(T value, string? message = null, string? code = null)Parameters
Section titled “Parameters”value T
message string?
code string?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”T
Conflict(string, string, BehaviorFault?)
Section titled “ Conflict(string, string, BehaviorFault?)”Creates a conflict result.
public static BehaviorResultDescriptor Conflict(string code, string message, BehaviorFault? fault = null)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”T
Created<T>(T, string?, string?)
Section titled “ Created<T>(T, string?, string?)”Creates a created result with a payload value.
public static Result<T> Created<T>(T value, string? message = null, string? code = null)Parameters
Section titled “Parameters”value T
message string?
code string?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”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)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”T
Invalid(string, string, BehaviorFault?)
Section titled “ Invalid(string, string, BehaviorFault?)”Creates an invalid-request result.
public static BehaviorResultDescriptor Invalid(string code, string message, BehaviorFault? fault = null)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”T
NoContent(string?, string?)
Section titled “ NoContent(string?, string?)”Creates a no-content result.
public static BehaviorResultDescriptor NoContent(string? message = null, string? code = null)Parameters
Section titled “Parameters”message string?
code string?
Returns
Section titled “Returns”NoContent<T>(string?, string?)
Section titled “ NoContent<T>(string?, string?)”Creates a no-content result for the specified payload type.
public static Result<T> NoContent<T>(string? message = null, string? code = null)Parameters
Section titled “Parameters”message string?
code string?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”T
NotFound(string, string, BehaviorFault?)
Section titled “ NotFound(string, string, BehaviorFault?)”Creates a not-found result.
public static BehaviorResultDescriptor NotFound(string code, string message, BehaviorFault? fault = null)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”T
Ok<T>(T, string?, string?)
Section titled “ Ok<T>(T, string?, string?)”Creates a successful result with a payload value.
public static Result<T> Ok<T>(T value, string? message = null, string? code = null)Parameters
Section titled “Parameters”value T
message string?
code string?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”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)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”code string
message string
fault BehaviorFault?
Returns
Section titled “Returns”Result<T>
Type Parameters
Section titled “Type Parameters”T