HttpResponse.OnStarting Method

Definition

Overloads

OnStarting(Func<Task>)

Adds a delegate to be invoked just before response headers will be sent to the client. Callbacks registered here run in reverse order.

OnStarting(Func<Object,Task>, Object)

Adds a delegate to be invoked just before response headers will be sent to the client. Callbacks registered here run in reverse order.

OnStarting(Func<Task>)

Source:
HttpResponse.cs
Source:
HttpResponse.cs
Source:
HttpResponse.cs

Adds a delegate to be invoked just before response headers will be sent to the client. Callbacks registered here run in reverse order.

public:
 virtual void OnStarting(Func<System::Threading::Tasks::Task ^> ^ callback);
public virtual void OnStarting (Func<System.Threading.Tasks.Task> callback);
abstract member OnStarting : Func<System.Threading.Tasks.Task> -> unit
override this.OnStarting : Func<System.Threading.Tasks.Task> -> unit
Public Overridable Sub OnStarting (callback As Func(Of Task))

Parameters

callback
Func<Task>

The delegate to execute.

Remarks

Callbacks registered here run in reverse order. The last one registered is invoked first. The reverse order is done to replicate the way middleware works, with the inner-most middleware looking at the response first.

Applies to

OnStarting(Func<Object,Task>, Object)

Source:
HttpResponse.cs
Source:
HttpResponse.cs
Source:
HttpResponse.cs

Adds a delegate to be invoked just before response headers will be sent to the client. Callbacks registered here run in reverse order.

public:
 abstract void OnStarting(Func<System::Object ^, System::Threading::Tasks::Task ^> ^ callback, System::Object ^ state);
public abstract void OnStarting (Func<object,System.Threading.Tasks.Task> callback, object state);
abstract member OnStarting : Func<obj, System.Threading.Tasks.Task> * obj -> unit
Public MustOverride Sub OnStarting (callback As Func(Of Object, Task), state As Object)

Parameters

callback
Func<Object,Task>

The delegate to execute.

state
Object

A state object to capture and pass back to the delegate.

Remarks

Callbacks registered here run in reverse order. The last one registered is invoked first. The reverse order is done to replicate the way middleware works, with the inner-most middleware looking at the response first.

Applies to