This repository has been archived by the owner on Nov 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
/
IApplicationBuilder.cs
50 lines (43 loc) · 1.91 KB
/
IApplicationBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNet.Http.Features;
namespace Microsoft.AspNet.Builder
{
/// <summary>
/// Defines a class that provides the mechanisms to configure an application's request pipeline.
/// </summary>
public interface IApplicationBuilder
{
/// <summary>
/// Gets or sets the <see cref="IServiceProvider"/> that provides access to the application's service container.
/// </summary>
IServiceProvider ApplicationServices { get; set; }
/// <summary>
/// Gets the set of HTTP features the application's server provides.
/// </summary>
IFeatureCollection ServerFeatures { get; }
/// <summary>
/// Gets a key/value collection that can be used to share data between middleware.
/// </summary>
IDictionary<string, object> Properties { get; }
/// <summary>
/// Adds a middleware delegate to the application's request pipeline.
/// </summary>
/// <param name="middleware">The middleware delgate.</param>
/// <returns>The <see cref="IApplicationBuilder"/>.</returns>
IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware);
/// <summary>
/// Creates a new <see cref="IApplicationBuilder"/> that shares the <see cref="Properties"/> of this
/// <see cref="IApplicationBuilder"/>.
/// </summary>
/// <returns>The new <see cref="IApplicationBuilder"/>.</returns>
IApplicationBuilder New();
/// <summary>
/// Builds the delegate used by this application to process HTTP requests.
/// </summary>
/// <returns>The request handling delegate.</returns>
RequestDelegate Build();
}
}