PR Feedback
* Sorting namespaces * Removing `as` casting for Frame's implemented interfaces
This commit is contained in:
parent
dc0eb679ae
commit
cbc3b4e6f5
|
|
@ -4,9 +4,10 @@
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNet.Http;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.AspNet.Http.Features;
|
||||||
using Microsoft.Dnx.Runtime;
|
|
||||||
using Microsoft.AspNet.Server.Kestrel;
|
using Microsoft.AspNet.Server.Kestrel;
|
||||||
|
using Microsoft.Dnx.Runtime;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
#if DNX451
|
#if DNX451
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
@ -20,7 +21,7 @@ namespace SampleApp
|
||||||
{
|
{
|
||||||
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IApplicationEnvironment env)
|
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;
|
//ksi.ThreadCount = 4;
|
||||||
|
|
||||||
loggerFactory.MinimumLevel = LogLevel.Debug;
|
loggerFactory.MinimumLevel = LogLevel.Debug;
|
||||||
|
|
@ -50,8 +51,6 @@ namespace SampleApp
|
||||||
context.Request.Path,
|
context.Request.Path,
|
||||||
context.Request.QueryString);
|
context.Request.QueryString);
|
||||||
|
|
||||||
foreach (var q in context.Request.Query) { }
|
|
||||||
|
|
||||||
context.Response.ContentLength = 11;
|
context.Response.ContentLength = 11;
|
||||||
context.Response.ContentType = "text/plain";
|
context.Response.ContentType = "text/plain";
|
||||||
await context.Response.WriteAsync("Hello world");
|
await context.Response.WriteAsync("Hello world");
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,10 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
{
|
{
|
||||||
public partial class Frame : IFeatureCollection, IHttpRequestFeature, IHttpResponseFeature, IHttpUpgradeFeature
|
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 _scheme;
|
||||||
private string _pathBase;
|
private string _pathBase;
|
||||||
private int _featureRevision;
|
private int _featureRevision;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// 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;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNet.Http.Features;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Server.KestrelTests
|
namespace Microsoft.AspNet.Server.KestrelTests
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Server.Kestrel.Filter;
|
using Microsoft.AspNet.Server.Kestrel.Filter;
|
||||||
using Microsoft.AspNet.Server.Kestrel.Http;
|
using Microsoft.AspNet.Server.Kestrel.Http;
|
||||||
using Xunit;
|
|
||||||
using Microsoft.AspNet.Http.Features;
|
using Microsoft.AspNet.Http.Features;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Server.KestrelTests
|
namespace Microsoft.AspNet.Server.KestrelTests
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,15 @@ namespace Microsoft.AspNet.Server.Kestrel.GeneratedCode
|
||||||
typeof(ISessionFeature),
|
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 $@"
|
return $@"
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue