PR Feedback

* Sorting namespaces
* Removing `as` casting for Frame's implemented interfaces
This commit is contained in:
Louis DeJardin 2015-10-06 15:03:00 -07:00
parent dc0eb679ae
commit cbc3b4e6f5
5 changed files with 19 additions and 7 deletions

View File

@ -4,9 +4,10 @@
using System;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Dnx.Runtime;
using Microsoft.AspNet.Http.Features;
using Microsoft.AspNet.Server.Kestrel;
using Microsoft.Dnx.Runtime;
using Microsoft.Extensions.Logging;
#if DNX451
using System.IO;
@ -20,7 +21,7 @@ namespace SampleApp
{
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IApplicationEnvironment env)
{
var ksi = app.ServerFeatures[typeof(IKestrelServerInformation)] as IKestrelServerInformation;
var ksi = app.ServerFeatures.Get<IKestrelServerInformation>();
//ksi.ThreadCount = 4;
loggerFactory.MinimumLevel = LogLevel.Debug;
@ -50,8 +51,6 @@ namespace SampleApp
context.Request.Path,
context.Request.QueryString);
foreach (var q in context.Request.Query) { }
context.Response.ContentLength = 11;
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello world");

View File

@ -16,6 +16,10 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
{
public partial class Frame : IFeatureCollection, IHttpRequestFeature, IHttpResponseFeature, IHttpUpgradeFeature
{
// NOTE: When feature interfaces are added to or removed from this Frame class implementation,
// then the list of `implementedFeatures` in the generated code project MUST also be updated.
// See also: tools/Microsoft.AspNet.Server.Kestrel.GeneratedCode/FrameFeatureCollection.cs
private string _scheme;
private string _pathBase;
private int _featureRevision;

View File

@ -1,10 +1,10 @@
// 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 Microsoft.AspNet.Http.Features;
using System;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.Http.Features;
using Xunit;
namespace Microsoft.AspNet.Server.KestrelTests

View File

@ -5,8 +5,8 @@ using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNet.Server.Kestrel.Filter;
using Microsoft.AspNet.Server.Kestrel.Http;
using Xunit;
using Microsoft.AspNet.Http.Features;
using Xunit;
namespace Microsoft.AspNet.Server.KestrelTests
{

View File

@ -45,6 +45,15 @@ namespace Microsoft.AspNet.Server.Kestrel.GeneratedCode
typeof(ISessionFeature),
};
// NOTE: This list MUST always match the set of feature interfaces implemented by Frame.
// See also: src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs
var implementedFeatures = new[]
{
typeof(IHttpRequestFeature),
typeof(IHttpResponseFeature),
typeof(IHttpUpgradeFeature),
};
return $@"
using System;
using System.Collections.Generic;