Make new HttpContext properties virtual (#10613)
This commit is contained in:
parent
760df198c8
commit
e16aa29e67
|
|
@ -250,7 +250,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
{
|
{
|
||||||
protected HttpRequest() { }
|
protected HttpRequest() { }
|
||||||
public abstract System.IO.Stream Body { get; set; }
|
public abstract System.IO.Stream Body { get; set; }
|
||||||
public abstract System.IO.Pipelines.PipeReader BodyReader { get; set; }
|
public virtual System.IO.Pipelines.PipeReader BodyReader { get { throw null; } set { } }
|
||||||
public abstract long? ContentLength { get; set; }
|
public abstract long? ContentLength { get; set; }
|
||||||
public abstract string ContentType { get; set; }
|
public abstract string ContentType { get; set; }
|
||||||
public abstract Microsoft.AspNetCore.Http.IRequestCookieCollection Cookies { get; set; }
|
public abstract Microsoft.AspNetCore.Http.IRequestCookieCollection Cookies { get; set; }
|
||||||
|
|
@ -274,7 +274,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
{
|
{
|
||||||
protected HttpResponse() { }
|
protected HttpResponse() { }
|
||||||
public abstract System.IO.Stream Body { get; set; }
|
public abstract System.IO.Stream Body { get; set; }
|
||||||
public abstract System.IO.Pipelines.PipeWriter BodyWriter { get; set; }
|
public virtual System.IO.Pipelines.PipeWriter BodyWriter { get { throw null; } set { } }
|
||||||
public abstract long? ContentLength { get; set; }
|
public abstract long? ContentLength { get; set; }
|
||||||
public abstract string ContentType { get; set; }
|
public abstract string ContentType { get; set; }
|
||||||
public abstract Microsoft.AspNetCore.Http.IResponseCookies Cookies { get; }
|
public abstract Microsoft.AspNetCore.Http.IResponseCookies Cookies { get; }
|
||||||
|
|
@ -290,7 +290,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
public abstract void Redirect(string location, bool permanent);
|
public abstract void Redirect(string location, bool permanent);
|
||||||
public virtual void RegisterForDispose(System.IDisposable disposable) { }
|
public virtual void RegisterForDispose(System.IDisposable disposable) { }
|
||||||
public virtual void RegisterForDisposeAsync(System.IAsyncDisposable disposable) { }
|
public virtual void RegisterForDisposeAsync(System.IAsyncDisposable disposable) { }
|
||||||
public abstract System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
public virtual System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
|
||||||
}
|
}
|
||||||
public static partial class HttpResponseWritingExtensions
|
public static partial class HttpResponseWritingExtensions
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// 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 System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Pipelines;
|
using System.IO.Pipelines;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
@ -106,7 +107,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the request body pipe <see cref="PipeReader"/>.
|
/// Gets or sets the request body pipe <see cref="PipeReader"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract PipeReader BodyReader { get; set; }
|
public virtual PipeReader BodyReader { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks the Content-Type header for form types.
|
/// Checks the Content-Type header for form types.
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the response body pipe <see cref="PipeWriter"/>
|
/// Gets or sets the response body pipe <see cref="PipeWriter"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract PipeWriter BodyWriter { get; set; }
|
public virtual PipeWriter BodyWriter { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the value for the <c>Content-Length</c> response header.
|
/// Gets or sets the value for the <c>Content-Length</c> response header.
|
||||||
|
|
@ -129,6 +129,6 @@ namespace Microsoft.AspNetCore.Http
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// If the <see cref="IHttpResponseStartFeature"/> isn't set, StartAsync will default to calling HttpResponse.Body.FlushAsync().
|
/// If the <see cref="IHttpResponseStartFeature"/> isn't set, StartAsync will default to calling HttpResponse.Body.FlushAsync().
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public abstract Task StartAsync(CancellationToken cancellationToken = default);
|
public virtual Task StartAsync(CancellationToken cancellationToken = default) { throw new NotImplementedException(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue