Class IResultResponse
IResult输出. 针对IResultResponse 请自行重写BaseQuickApi.HandlerBuilder方法的OpenApi实现
[Obsolete("请直接使用IResult返回")]
public sealed class IResultResponse
- Inheritance
-
IResultResponse
- Inherited Members
- Extension Methods
Constructors
IResultResponse(IResult)
IResult输出. 针对IResultResponse 请自行重写BaseQuickApi.HandlerBuilder方法的OpenApi实现
public IResultResponse(IResult result)
Parameters
result
IResult
Properties
Empty
Empty
public static IResultResponse Empty { get; }
Property Value
NotFound
NotFound
public static IResultResponse NotFound { get; }
Property Value
Result
public IResult Result { get; set; }
Property Value
Unauthorized
Unauthorized
public static IResultResponse Unauthorized { get; }
Property Value
Methods
BadRequest(object?)
BadRequest
public static IResultResponse BadRequest(object? error = null)
Parameters
error
object
Returns
Content(string?, string?, Encoding?, int?)
Content
public static IResultResponse Content(string? content, string? contentType = null, Encoding? encoding = null, int? statusCode = null)
Parameters
Returns
File(string, string?, string?, bool)
File
public static IResultResponse File(string path, string? contentType = null, string? fileDownloadName = null, bool enableRangeProcessing = false)
Parameters
Returns
Json<T>(T, JsonSerializerOptions?, string?, int?)
Json
public static IResultResponse Json<T>(T value, JsonSerializerOptions? serializerOptions = null, string? contentType = null, int? statusCode = null)
Parameters
value
TserializerOptions
JsonSerializerOptionscontentType
stringstatusCode
int?
Returns
Type Parameters
T
OK(object?)
直接返回OK
public static IResultResponse OK(object? value = null)
Parameters
value
object
Returns
Problem(ProblemDetails)
Problem
public static IResultResponse Problem(ProblemDetails problemDetails)
Parameters
problemDetails
ProblemDetails
Returns
Problem(string?, string?, int?, string?, string?, IDictionary<string, object?>?)
Problem
public static IResultResponse Problem(string? detail = null, string? instance = null, int? statusCode = null, string? title = null, string? type = null, IDictionary<string, object?>? extensions = null)
Parameters
detail
stringinstance
stringstatusCode
int?title
stringtype
stringextensions
IDictionary<string, object>
Returns
Redirect(string, bool, bool)
Redirect
public static IResultResponse Redirect(string url, bool permanent = false, bool preserveMethod = false)
Parameters
Returns
StatusCode(int)
StatusCode
public static IResultResponse StatusCode(int statusCode)
Parameters
statusCode
int
Returns
Stream(Stream, string?, string?, bool)
Stream
public static IResultResponse Stream(Stream stream, string? contentType = null, string? fileDownloadName = null, bool enableRangeProcessing = false)
Parameters
Returns
Text(string, string?, Encoding?, int?)
Text
public static IResultResponse Text(string text, string? contentType = null, Encoding? encoding = null, int? statusCode = null)