Add SetStatusCodeWriteLineDisposeAsync helper function
This commit is contained in:
parent
81dd1f8bd5
commit
d152b8f3ae
|
|
@ -35,6 +35,12 @@ public class RequestContext : IDisposable {
|
|||
|
||||
public void SetStatusCode(HttpStatusCode status) => SetStatusCode((int) status);
|
||||
|
||||
public async Task SetStatusCodeWriteLineDisposeAsync(HttpStatusCode status, string message) {
|
||||
SetStatusCode(status);
|
||||
await WriteLineToRespAsync(message);
|
||||
await RespWriter.FlushAsync();
|
||||
}
|
||||
|
||||
public async Task SetStatusCodeAndDisposeAsync(int status) {
|
||||
using (this) {
|
||||
SetStatusCode(status);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user