aspnetcore/src/Microsoft.AspNet.Http.Abstr.../HttpContext.cs

55 lines
1.5 KiB
C#

// 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 System.Security.Claims;
using System.Threading;
using Microsoft.AspNet.Http.Authentication;
namespace Microsoft.AspNet.Http
{
public abstract class HttpContext : IDisposable
{
public abstract HttpRequest Request { get; }
public abstract HttpResponse Response { get; }
public abstract ConnectionInfo Connection { get; }
public abstract AuthenticationManager Authentication { get; }
public abstract ClaimsPrincipal User { get; set; }
public abstract IDictionary<object, object> Items { get; }
public abstract IServiceProvider ApplicationServices { get; set; }
public abstract IServiceProvider RequestServices { get; set; }
public abstract CancellationToken RequestAborted { get; }
public abstract ISessionCollection Session { get; }
public abstract WebSocketManager WebSockets { get; }
public abstract void Abort();
public abstract void Dispose();
public abstract object GetFeature(Type type);
public abstract void SetFeature(Type type, object instance);
public virtual T GetFeature<T>()
{
return (T)GetFeature(typeof(T));
}
public virtual void SetFeature<T>(T instance)
{
SetFeature(typeof(T), instance);
}
}
}