类库Microsoft.Owin.Host.SystemWeb
扩展HttpContext以及HttpRequest ,新增了方法GetOwinContext
//
// Summary:
// Provides extension methods for System.Web.HttpContext.
public static class HttpContextExtensions
{
//
// Summary:
// Gets the Microsoft.Owin.IOwinContext for the current request.
//
// Parameters:
// context:
public static IOwinContext GetOwinContext(this HttpContext context);
//
// Summary:
// Gets the Microsoft.Owin.IOwinContext for the current request.
//
// Parameters:
// request:
public static IOwinContext GetOwinContext(this HttpRequest request);
}
实际调用
HttpContext.Current.GetOwinContext();
HttpContext.Current.Request.GetOwinContext();