Change IApplicationBuilder.Server to IFeatureCollection ServerFeatures.

This commit is contained in:
Chris R 2015-08-31 11:25:59 -07:00
parent e45e70da01
commit c3290a029f
3 changed files with 7 additions and 5 deletions

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNet.Http.Features;
namespace Microsoft.AspNet.Builder namespace Microsoft.AspNet.Builder
{ {
@ -10,7 +11,7 @@ namespace Microsoft.AspNet.Builder
{ {
IServiceProvider ApplicationServices { get; set; } IServiceProvider ApplicationServices { get; set; }
object Server { get; } IFeatureCollection ServerFeatures { get; }
IDictionary<string, object> Properties { get; } IDictionary<string, object> Properties { get; }

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Http.Features;
using Microsoft.AspNet.Http.Internal; using Microsoft.AspNet.Http.Internal;
namespace Microsoft.AspNet.Builder.Internal namespace Microsoft.AspNet.Builder.Internal
@ -22,7 +23,7 @@ namespace Microsoft.AspNet.Builder.Internal
public ApplicationBuilder(IServiceProvider serviceProvider, object server) public ApplicationBuilder(IServiceProvider serviceProvider, object server)
: this(serviceProvider) : this(serviceProvider)
{ {
SetProperty(Constants.BuilderProperties.ServerInformation, server); SetProperty(Constants.BuilderProperties.ServerFeatures, server);
} }
private ApplicationBuilder(ApplicationBuilder builder) private ApplicationBuilder(ApplicationBuilder builder)
@ -42,11 +43,11 @@ namespace Microsoft.AspNet.Builder.Internal
} }
} }
public object Server public IFeatureCollection ServerFeatures
{ {
get get
{ {
return GetProperty<object>(Constants.BuilderProperties.ServerInformation); return GetProperty<IFeatureCollection>(Constants.BuilderProperties.ServerFeatures);
} }
} }

View File

@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Http.Internal
internal static class BuilderProperties internal static class BuilderProperties
{ {
internal static string ServerInformation = "server.Information"; internal static string ServerFeatures = "server.Features";
internal static string ApplicationServices = "application.Services"; internal static string ApplicationServices = "application.Services";
} }
} }