mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Adding Owin support
Some tests are broken right now
This commit is contained in:
BIN
lib/owin/Microsoft.Owin.Host.SystemWeb.dll
Normal file
BIN
lib/owin/Microsoft.Owin.Host.SystemWeb.dll
Normal file
Binary file not shown.
540
lib/owin/Microsoft.Owin.Host.SystemWeb.xml
Normal file
540
lib/owin/Microsoft.Owin.Host.SystemWeb.xml
Normal file
@@ -0,0 +1,540 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Microsoft.Owin.Host.SystemWeb</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Owin.Loader.DefaultLoader">
|
||||
<summary>
|
||||
Locates the startup class based on the following convention:
|
||||
AssemblyName.Startup, with a method named Configuration
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Owin.Loader.DefaultLoader.#ctor">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Owin.Loader.DefaultLoader.#ctor(System.Func{System.String,System.Collections.Generic.IList{System.String},System.Action{Owin.IAppBuilder}})">
|
||||
<summary>
|
||||
Allows for a fallback loader to be specified.
|
||||
</summary>
|
||||
<param name="next"></param>
|
||||
</member>
|
||||
<member name="M:Owin.Loader.DefaultLoader.#ctor(System.Func{System.String,System.Collections.Generic.IList{System.String},System.Action{Owin.IAppBuilder}},System.Func{System.Type,System.Object})">
|
||||
<summary>
|
||||
Allows for a fallback loader and a Dependency Injection activator to be specified.
|
||||
</summary>
|
||||
<param name="next"></param>
|
||||
<param name="activator"></param>
|
||||
</member>
|
||||
<member name="M:Owin.Loader.DefaultLoader.#ctor(System.Func{System.String,System.Collections.Generic.IList{System.String},System.Action{Owin.IAppBuilder}},System.Func{System.Type,System.Object},System.Collections.Generic.IEnumerable{System.Reflection.Assembly})">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="next"></param>
|
||||
<param name="activator"></param>
|
||||
<param name="referencedAssemblies"></param>
|
||||
</member>
|
||||
<member name="M:Owin.Loader.DefaultLoader.Load(System.String,System.Collections.Generic.IList{System.String})">
|
||||
<summary>
|
||||
Executes the loader, searching for the entry point by name.
|
||||
</summary>
|
||||
<param name="startupName">The name of the assembly and type entry point</param>
|
||||
<param name="errorDetails"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Owin.Loader.DefaultLoader.DotByDot(System.String)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="text"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Owin.Loader.NullLoader">
|
||||
<summary>
|
||||
A default fallback loader that does nothing.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Owin.Loader.NullLoader.Load(System.String,System.Collections.Generic.IList{System.String})">
|
||||
<summary>
|
||||
A placeholder method that always returns null.
|
||||
</summary>
|
||||
<param name="startup"></param>
|
||||
<param name="errors"></param>
|
||||
<returns>null.</returns>
|
||||
</member>
|
||||
<member name="P:Owin.Loader.NullLoader.Instance">
|
||||
<summary>
|
||||
A singleton instance of the NullLoader type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:SharedResourceNamespace.LoaderResources">
|
||||
<summary>
|
||||
A strongly-typed resource class, for looking up localized strings, etc.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.ResourceManager">
|
||||
<summary>
|
||||
Returns the cached ResourceManager instance used by this class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.Culture">
|
||||
<summary>
|
||||
Overrides the current thread's CurrentUICulture property for all
|
||||
resource lookups using this strongly typed resource class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.AssemblyNotFound">
|
||||
<summary>
|
||||
Looks up a localized string similar to For the app startup parameter value '{0}', the assembly '{1}' was not found..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.ClassNotFoundInAssembly">
|
||||
<summary>
|
||||
Looks up a localized string similar to For the app startup parameter value '{0}', the class '{1}' was not found in assembly '{2}'..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.Exception_AttributeNameConflict">
|
||||
<summary>
|
||||
Looks up a localized string similar to The OwinStartup attribute discovered in assembly '{0}' referencing startup type '{1}' conflicts with the attribute in assembly '{2}' referencing startup type '{3}' because they have the same FriendlyName '{4}'. Remove or rename one of the attributes, or reference the desired type directly..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.Exception_StartupTypeConflict">
|
||||
<summary>
|
||||
Looks up a localized string similar to The discovered startup type '{0}' conflicts with the type '{1}'. Remove or rename one of the types, or reference the desired type directly..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.FriendlyNameMismatch">
|
||||
<summary>
|
||||
Looks up a localized string similar to The OwinStartupAttribute.FriendlyName value '{0}' does not match the given value '{1}' in Assembly '{2}'..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.MethodNotFoundInClass">
|
||||
<summary>
|
||||
Looks up a localized string similar to No '{0}' method was found in class '{1}'..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.NoAssemblyWithStartupClass">
|
||||
<summary>
|
||||
Looks up a localized string similar to No assembly found containing a Startup or [AssemblyName].Startup class..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.NoOwinStartupAttribute">
|
||||
<summary>
|
||||
Looks up a localized string similar to No assembly found containing an OwinStartupAttribute..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.StartupTypePropertyEmpty">
|
||||
<summary>
|
||||
Looks up a localized string similar to The OwinStartupAttribute.StartupType value is empty in Assembly '{0}'..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.StartupTypePropertyMissing">
|
||||
<summary>
|
||||
Looks up a localized string similar to The type '{0}' referenced from assembly '{1}' does not define a property 'StartupType' of type 'Type'..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.TypeOrMethodNotFound">
|
||||
<summary>
|
||||
Looks up a localized string similar to The given type or method '{0}' was not found. Try specifying the Assembly..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SharedResourceNamespace.LoaderResources.UnexpectedMethodSignature">
|
||||
<summary>
|
||||
Looks up a localized string similar to The '{0}' method on class '{1}' does not have the expected signature 'void {0}(IAppBuilder)'..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Owin.Host.SystemWeb.AuthenticationResult">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.AuthenticationResult.#ctor(System.Security.Principal.IIdentity,System.Collections.Generic.IDictionary{System.String,System.String},System.Collections.Generic.IDictionary{System.String,System.Object})">
|
||||
<summary></summary>
|
||||
<param name="identity"></param>
|
||||
<param name="extra"></param>
|
||||
<param name="properties"></param>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.AuthenticationResult.Identity">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.AuthenticationResult.Extra">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.AuthenticationResult.Properties">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Owin.Host.SystemWeb.DataProtection.MachineKeyDataProtectionProvider">
|
||||
<summary>
|
||||
Used to provide the data protection services that are derived from the MachineKey API. It is the best choice of
|
||||
data protection when you application is hosted by ASP.NET and all servers in the farm are running with the same Machine Key values.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.DataProtection.MachineKeyDataProtectionProvider.Create(System.String[])">
|
||||
<summary>
|
||||
Returns a new instance of IDataProtection for the provider.
|
||||
</summary>
|
||||
<param name="purposes">Additional entropy used to ensure protected data may only be unprotected for the correct purposes.</param>
|
||||
<returns>An instance of a data protection service</returns>
|
||||
</member>
|
||||
<member name="T:System.Web.HttpContextBaseExtensions">
|
||||
<summary>Provides extension methods for <see cref="T:System.Web.HttpContextBase"/>.</summary>
|
||||
</member>
|
||||
<member name="M:System.Web.HttpContextBaseExtensions.GetOwinContext(System.Web.HttpContextBase)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="context"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:System.Web.HttpContextBaseExtensions.GetOwinContext(System.Web.HttpRequestBase)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="request"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:System.Web.HttpContextExtensions">
|
||||
<summary>Provides extension methods for <see cref="T:System.Web.HttpContext"/>.</summary>
|
||||
</member>
|
||||
<member name="M:System.Web.HttpContextExtensions.GetOwinContext(System.Web.HttpContext)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="context"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:System.Web.HttpContextExtensions.GetOwinContext(System.Web.HttpRequest)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="request"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Microsoft.Owin.Host.SystemWeb.OwinHttpHandler">
|
||||
<summary>
|
||||
Processes requests from System.Web as OWIN requests.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.#ctor">
|
||||
<summary>
|
||||
Processes requests using the default OWIN application.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(System.Web.HttpContextBase,System.AsyncCallback,System.Object)">
|
||||
<summary>
|
||||
Initiates an asynchronous call to the HTTP handler.
|
||||
</summary>
|
||||
<param name="httpContext">
|
||||
An System.Web.HttpContextBase object that provides references to intrinsic server
|
||||
objects (for example, Request, Response, Session, and Server) used to service
|
||||
HTTP requests.
|
||||
</param>
|
||||
<param name="callback">
|
||||
The System.AsyncCallback to call when the asynchronous method call is complete.
|
||||
If callback is null, the delegate is not called.
|
||||
</param>
|
||||
<param name="extraData">
|
||||
Any extra data needed to process the request.
|
||||
</param>
|
||||
<returns>
|
||||
An System.IAsyncResult that contains information about the status of the process.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.EndProcessRequest(System.IAsyncResult)">
|
||||
<summary>
|
||||
Provides an asynchronous process End method when the process ends.
|
||||
</summary>
|
||||
<param name="result">
|
||||
An System.IAsyncResult that contains information about the status of the process.
|
||||
</param>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.IsReusable">
|
||||
<summary>
|
||||
Gets a value indicating whether another request can use the System.Web.IHttpHandler instance.
|
||||
</summary>
|
||||
<returns>
|
||||
true.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:Microsoft.Owin.Host.SystemWeb.OwinRouteHandler">
|
||||
<summary>
|
||||
Processes a route through an OWIN pipeline.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.OwinRouteHandler.#ctor(System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Initialize an OwinRouteHandler
|
||||
</summary>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.OwinRouteHandler.GetHttpHandler(System.Web.Routing.RequestContext)">
|
||||
<summary>
|
||||
Provides the object that processes the request.
|
||||
</summary>
|
||||
<returns>
|
||||
An object that processes the request.
|
||||
</returns>
|
||||
<param name="requestContext">An object that encapsulates information about the request.</param>
|
||||
</member>
|
||||
<member name="T:Microsoft.Owin.Host.SystemWeb.PreApplicationStart">
|
||||
<summary>
|
||||
Registers the OWIN request processing module at application startup.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Owin.Host.SystemWeb.PreApplicationStart.Initialize">
|
||||
<summary>
|
||||
Registers the OWIN request processing module.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Owin.Host.SystemWeb.Resources">
|
||||
<summary>
|
||||
A strongly-typed resource class, for looking up localized strings, etc.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.ResourceManager">
|
||||
<summary>
|
||||
Returns the cached ResourceManager instance used by this class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Culture">
|
||||
<summary>
|
||||
Overrides the current thread's CurrentUICulture property for all
|
||||
resource lookups using this strongly typed resource class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Exception_AppLoderFailure">
|
||||
<summary>
|
||||
Looks up a localized string similar to The following errors occurred while attempting to load the app..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Exception_CannotRegisterAfterHeadersSent">
|
||||
<summary>
|
||||
Looks up a localized string similar to Cannot register for 'OnSendingHeaders' event after response headers have been sent..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Exception_DuplicateKey">
|
||||
<summary>
|
||||
Looks up a localized string similar to The key '{0}' is already present in the dictionary..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Exception_HowToDisableAutoAppStartup">
|
||||
<summary>
|
||||
Looks up a localized string similar to To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Exception_HowToSpecifyAppStartup">
|
||||
<summary>
|
||||
Looks up a localized string similar to To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Exception_UnsupportedPipelineStage">
|
||||
<summary>
|
||||
Looks up a localized string similar to The given stage '{0}' is not supported..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.HttpContext_OwinEnvironmentNotFound">
|
||||
<summary>
|
||||
Looks up a localized string similar to No owin.Environment item was found in the context..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_ClientCertException">
|
||||
<summary>
|
||||
Looks up a localized string similar to An exception was thrown while trying to load the client certificate:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_EntryPointException">
|
||||
<summary>
|
||||
Looks up a localized string similar to The OWIN entry point threw an exception:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_OwinCallContextCallbackException">
|
||||
<summary>
|
||||
Looks up a localized string similar to The IAsyncResult callback for OwinCallHandler threw an exception:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_RegisterModuleException">
|
||||
<summary>
|
||||
Looks up a localized string similar to Failed to register the OWIN module:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_RequestDisconnectCallbackExceptions">
|
||||
<summary>
|
||||
Looks up a localized string similar to The application threw one or more exceptions when notified of a client disconnect:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_ShutdownDetectionSetupException">
|
||||
<summary>
|
||||
Looks up a localized string similar to Shutdown detection setup failed:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_ShutdownException">
|
||||
<summary>
|
||||
Looks up a localized string similar to One or more exceptions were thrown during app pool shutdown:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_TimerCallbackException">
|
||||
<summary>
|
||||
Looks up a localized string similar to An exception was thrown from a timer callback:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_WebSocketException">
|
||||
<summary>
|
||||
Looks up a localized string similar to An exception was thrown while processing the WebSocket:.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_WebSocketsSupportDetected">
|
||||
<summary>
|
||||
Looks up a localized string similar to Support for WebSockets has been detected..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Owin.Host.SystemWeb.Resources.Trace_WebSocketsSupportNotDetected">
|
||||
<summary>
|
||||
Looks up a localized string similar to No support for WebSockets has been detected..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:System.Web.Routing.RouteCollectionExtensions">
|
||||
<summary>
|
||||
Provides extension methods for registering OWIN applications as System.Web routes.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinPath(System.Web.Routing.RouteCollection,System.String)">
|
||||
<summary>
|
||||
Registers a route for the default OWIN application.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="pathBase">The route path to map to the default OWIN application.</param>
|
||||
<returns>The created route.</returns>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinPath``1(System.Web.Routing.RouteCollection,System.String,``0)">
|
||||
<summary>
|
||||
Registers a route for a specific OWIN application entry point.
|
||||
</summary>
|
||||
<typeparam name="TApp">The OWIN application entry point type.</typeparam>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="pathBase">The route path to map to the given OWIN application.</param>
|
||||
<param name="app">The OWIN application entry point.</param>
|
||||
<returns>The created route.</returns>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinPath(System.Web.Routing.RouteCollection,System.String,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Invokes the System.Action startup delegate to build the OWIN application
|
||||
and then registers a route for it on the given path.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="pathBase">The route path to map to the given OWIN application.</param>
|
||||
<param name="startup">A System.Action delegate invoked to build the OWIN application.</param>
|
||||
<returns>The created route.</returns>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinPath(System.Web.Routing.RouteCollection,System.String,System.String)">
|
||||
<summary>
|
||||
Registers a route for the default OWIN application.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="name">The given name of the route.</param>
|
||||
<param name="pathBase">The route path to map to the default OWIN application.</param>
|
||||
<returns>The created route.</returns>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinPath``1(System.Web.Routing.RouteCollection,System.String,System.String,``0)">
|
||||
<summary>
|
||||
Registers a route for a specific OWIN application entry point.
|
||||
</summary>
|
||||
<typeparam name="TApp">The OWIN application entry point type.</typeparam>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="name">The given name of the route.</param>
|
||||
<param name="pathBase">The route path to map to the given OWIN application.</param>
|
||||
<param name="app">The OWIN application entry point.</param>
|
||||
<returns>The created route.</returns>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinPath(System.Web.Routing.RouteCollection,System.String,System.String,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Invokes the System.Action startup delegate to build the OWIN application
|
||||
and then registers a route for it on the given path.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="name">The given name of the route.</param>
|
||||
<param name="pathBase">The route path to map to the given OWIN application.</param>
|
||||
<param name="startup">A System.Action delegate invoked to build the OWIN application.</param>
|
||||
<returns>The created route.</returns>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.Web.Routing.RouteValueDictionary,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="defaults">The values to use if the URL does not contain all the parameters.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="defaults">The values to use if the URL does not contain all the parameters.</param>
|
||||
<param name="constraints">A regular expression that specifies valid values for a URL parameter.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="defaults">The values to use if the URL does not contain all the parameters.</param>
|
||||
<param name="constraints">A regular expression that specifies valid values for a URL parameter.</param>
|
||||
<param name="dataTokens">Custom values that are passed to the route handler, but which are not used to determine whether the route matches a specific URL pattern. These values are passed to the route handler, where they can be used for processing the request.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.String,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeName">The name of the route.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.String,System.Web.Routing.RouteValueDictionary,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeName">The name of the route.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="defaults">The values to use if the URL does not contain all the parameters.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.String,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeName">The name of the route.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="defaults">The values to use if the URL does not contain all the parameters.</param>
|
||||
<param name="constraints">A regular expression that specifies valid values for a URL parameter.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
<member name="M:System.Web.Routing.RouteCollectionExtensions.MapOwinRoute(System.Web.Routing.RouteCollection,System.String,System.String,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary,System.Action{Owin.IAppBuilder})">
|
||||
<summary>
|
||||
Provides a way to define routes for an OWIN pipeline.
|
||||
</summary>
|
||||
<param name="routes">The route collection.</param>
|
||||
<param name="routeName">The name of the route.</param>
|
||||
<param name="routeUrl">The URL pattern for the route.</param>
|
||||
<param name="defaults">The values to use if the URL does not contain all the parameters.</param>
|
||||
<param name="constraints">A regular expression that specifies valid values for a URL parameter.</param>
|
||||
<param name="dataTokens">Custom values that are passed to the route handler, but which are not used to determine whether the route matches a specific URL pattern. These values are passed to the route handler, where they can be used for processing the request.</param>
|
||||
<param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
2892
lib/owin/Microsoft.Owin.XML
Normal file
2892
lib/owin/Microsoft.Owin.XML
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lib/owin/Microsoft.Owin.dll
Normal file
BIN
lib/owin/Microsoft.Owin.dll
Normal file
Binary file not shown.
BIN
lib/owin/Owin.dll
Normal file
BIN
lib/owin/Owin.dll
Normal file
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using NUnit.Framework;
|
||||
@@ -65,6 +66,8 @@ namespace Orchard.Tests.Environment {
|
||||
Routes = routes;
|
||||
}
|
||||
public IEnumerable<RouteDescriptor> Routes { get; set; }
|
||||
public void Publish(IEnumerable<RouteDescriptor> routes, Func<IDictionary<string, object>, Task> pipeline) {
|
||||
}
|
||||
}
|
||||
|
||||
public class StubModelBinderProvider : IModelBinderProvider {
|
||||
|
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
@@ -43,6 +45,11 @@ namespace Orchard.Tests.Mvc.Routes {
|
||||
rootBuilder.RegisterType<StubAsyncTokenProvider>().As<IAsyncTokenProvider>();
|
||||
rootBuilder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();
|
||||
|
||||
rootBuilder.Register<Func<RouteBase, ShellRoute>>(c => {
|
||||
var context = c.Resolve<IComponentContext>();
|
||||
return new
|
||||
});
|
||||
|
||||
_rootContainer = rootBuilder.Build();
|
||||
|
||||
_containerA = _rootContainer.BeginLifetimeScope(
|
||||
@@ -59,7 +66,7 @@ namespace Orchard.Tests.Mvc.Routes {
|
||||
builder.RegisterType<RoutePublisher>().As<IRoutePublisher>().InstancePerMatchingLifetimeScope("shell");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void FactoryMethodWillCreateShellRoutes() {
|
||||
var settings = new ShellSettings { Name = "Alpha" };
|
||||
|
@@ -13,6 +13,7 @@
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false"/>
|
||||
<add key="log4net.Config" value="Config\log4net.config"/>
|
||||
<add key="owin:AppStartup" value="Orchard.Owin.Startup, Orchard.Framework" />
|
||||
</appSettings>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
|
@@ -1,12 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Autofac.Features.OwnedInstances;
|
||||
using Microsoft.Owin.Builder;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.ModelBinders;
|
||||
using Orchard.Mvc.Routes;
|
||||
using Orchard.Owin;
|
||||
using Orchard.Tasks;
|
||||
using Orchard.UI;
|
||||
using Orchard.WebApi.Routes;
|
||||
using Owin;
|
||||
using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider;
|
||||
|
||||
namespace Orchard.Environment {
|
||||
@@ -18,6 +24,8 @@ namespace Orchard.Environment {
|
||||
private readonly IEnumerable<IModelBinderProvider> _modelBinderProviders;
|
||||
private readonly IModelBinderPublisher _modelBinderPublisher;
|
||||
private readonly ISweepGenerator _sweepGenerator;
|
||||
private readonly IEnumerable<IOwinMiddlewareProvider> _owinMiddlewareProviders;
|
||||
private readonly ShellSettings _shellSettings;
|
||||
|
||||
public DefaultOrchardShell(
|
||||
Func<Owned<IOrchardShellEvents>> eventsFactory,
|
||||
@@ -26,7 +34,9 @@ namespace Orchard.Environment {
|
||||
IRoutePublisher routePublisher,
|
||||
IEnumerable<IModelBinderProvider> modelBinderProviders,
|
||||
IModelBinderPublisher modelBinderPublisher,
|
||||
ISweepGenerator sweepGenerator) {
|
||||
ISweepGenerator sweepGenerator,
|
||||
IEnumerable<IOwinMiddlewareProvider> owinMiddlewareProviders,
|
||||
ShellSettings shellSettings) {
|
||||
_eventsFactory = eventsFactory;
|
||||
_routeProviders = routeProviders;
|
||||
_httpRouteProviders = httpRouteProviders;
|
||||
@@ -34,6 +44,8 @@ namespace Orchard.Environment {
|
||||
_modelBinderProviders = modelBinderProviders;
|
||||
_modelBinderPublisher = modelBinderPublisher;
|
||||
_sweepGenerator = sweepGenerator;
|
||||
_owinMiddlewareProviders = owinMiddlewareProviders;
|
||||
_shellSettings = shellSettings;
|
||||
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
@@ -41,11 +53,27 @@ namespace Orchard.Environment {
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public void Activate() {
|
||||
IAppBuilder appBuilder = new AppBuilder();
|
||||
appBuilder.Properties["host.AppName"] = _shellSettings.Name;
|
||||
|
||||
var orderedMiddlewares = _owinMiddlewareProviders
|
||||
.SelectMany(p => p.GetOwinMiddlewares())
|
||||
.OrderBy(obj => obj.Priority, new FlatPositionComparer());
|
||||
|
||||
foreach (var middleware in orderedMiddlewares) {
|
||||
middleware.Configure(appBuilder);
|
||||
}
|
||||
|
||||
// register the Orchard middleware after all others
|
||||
appBuilder.UseOrchard();
|
||||
|
||||
Func<IDictionary<string, object>, Task> pipeline = appBuilder.Build();
|
||||
|
||||
var allRoutes = new List<RouteDescriptor>();
|
||||
allRoutes.AddRange(_routeProviders.SelectMany(provider => provider.GetRoutes()));
|
||||
allRoutes.AddRange(_httpRouteProviders.SelectMany(provider => provider.GetRoutes()));
|
||||
|
||||
_routePublisher.Publish(allRoutes);
|
||||
_routePublisher.Publish(allRoutes, pipeline);
|
||||
_modelBinderPublisher.Publish(_modelBinderProviders.SelectMany(provider => provider.GetModelBinders()));
|
||||
|
||||
using (var events = _eventsFactory()) {
|
||||
|
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Orchard.Mvc.Routes {
|
||||
public interface IRoutePublisher : IDependency {
|
||||
void Publish(IEnumerable<RouteDescriptor> routes);
|
||||
void Publish(IEnumerable<RouteDescriptor> routes, Func<IDictionary<string, object>, Task> pipeline = null);
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
@@ -31,7 +32,7 @@ namespace Orchard.Mvc.Routes {
|
||||
_extensionManager = extensionManager;
|
||||
}
|
||||
|
||||
public void Publish(IEnumerable<RouteDescriptor> routes) {
|
||||
public void Publish(IEnumerable<RouteDescriptor> routes, Func<IDictionary<string, object>, Task> env) {
|
||||
var routesArray = routes
|
||||
.OrderByDescending(r => r.Priority)
|
||||
.ToArray();
|
||||
@@ -51,7 +52,7 @@ namespace Orchard.Mvc.Routes {
|
||||
|
||||
preloading.Add(routeDescriptor.Name, routeDescriptor.Route);
|
||||
}
|
||||
|
||||
|
||||
|
||||
using (_routeCollection.GetWriteLock()) {
|
||||
// existing routes are removed while the collection is briefly inaccessable
|
||||
@@ -60,7 +61,7 @@ namespace Orchard.Mvc.Routes {
|
||||
.Where(sr => sr.ShellSettingsName == _shellSettings.Name)
|
||||
.ToArray();
|
||||
|
||||
foreach(var crop in cropArray) {
|
||||
foreach (var crop in cropArray) {
|
||||
_routeCollection.Remove(crop);
|
||||
}
|
||||
|
||||
@@ -70,17 +71,17 @@ namespace Orchard.Mvc.Routes {
|
||||
var defaultSessionState = SessionStateBehavior.Default;
|
||||
|
||||
ExtensionDescriptor extensionDescriptor = null;
|
||||
if(routeDescriptor.Route is Route) {
|
||||
if (routeDescriptor.Route is Route) {
|
||||
object extensionId;
|
||||
var route = routeDescriptor.Route as Route;
|
||||
if(route.DataTokens != null && route.DataTokens.TryGetValue("area", out extensionId) ||
|
||||
if (route.DataTokens != null && route.DataTokens.TryGetValue("area", out extensionId) ||
|
||||
route.Defaults != null && route.Defaults.TryGetValue("area", out extensionId)) {
|
||||
extensionDescriptor = _extensionManager.GetExtension(extensionId.ToString());
|
||||
extensionDescriptor = _extensionManager.GetExtension(extensionId.ToString());
|
||||
}
|
||||
}
|
||||
else if(routeDescriptor.Route is IRouteWithArea) {
|
||||
else if (routeDescriptor.Route is IRouteWithArea) {
|
||||
var route = routeDescriptor.Route as IRouteWithArea;
|
||||
extensionDescriptor = _extensionManager.GetExtension(route.Area);
|
||||
extensionDescriptor = _extensionManager.GetExtension(route.Area);
|
||||
}
|
||||
|
||||
if (extensionDescriptor != null) {
|
||||
@@ -91,9 +92,9 @@ namespace Orchard.Mvc.Routes {
|
||||
}
|
||||
|
||||
// Route-level setting overrides module-level setting (from manifest).
|
||||
var sessionStateBehavior = routeDescriptor.SessionState == SessionStateBehavior.Default ? defaultSessionState : routeDescriptor.SessionState ;
|
||||
var sessionStateBehavior = routeDescriptor.SessionState == SessionStateBehavior.Default ? defaultSessionState : routeDescriptor.SessionState;
|
||||
|
||||
var shellRoute = new ShellRoute(routeDescriptor.Route, _shellSettings, _workContextAccessor, _runningShellTable) {
|
||||
var shellRoute = new ShellRoute(routeDescriptor.Route, _shellSettings, _workContextAccessor, _runningShellTable, env) {
|
||||
IsHttpRoute = routeDescriptor is HttpRouteDescriptor,
|
||||
SessionState = sessionStateBehavior
|
||||
};
|
||||
@@ -101,7 +102,7 @@ namespace Orchard.Mvc.Routes {
|
||||
try {
|
||||
_routeCollection.Add(routeDescriptor.Name, shellRoute);
|
||||
}
|
||||
catch(ArgumentException) {
|
||||
catch (ArgumentException) {
|
||||
// Named routes can be added multiple times in the case of a module
|
||||
// loaded in multiple tenants. There is no way to ensure a named route
|
||||
// is already registered, thus catching the specific exception.
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
@@ -15,12 +16,14 @@ namespace Orchard.Mvc.Routes {
|
||||
private readonly ShellSettings _shellSettings;
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IRunningShellTable _runningShellTable;
|
||||
private readonly Func<IDictionary<string, object>, Task> _pipeline;
|
||||
private readonly UrlPrefix _urlPrefix;
|
||||
|
||||
public ShellRoute(RouteBase route, ShellSettings shellSettings, IWorkContextAccessor workContextAccessor, IRunningShellTable runningShellTable) {
|
||||
public ShellRoute(RouteBase route, ShellSettings shellSettings, IWorkContextAccessor workContextAccessor, IRunningShellTable runningShellTable, Func<IDictionary<string, object>, Task> pipeline) {
|
||||
_route = route;
|
||||
_shellSettings = shellSettings;
|
||||
_runningShellTable = runningShellTable;
|
||||
_pipeline = pipeline;
|
||||
_workContextAccessor = workContextAccessor;
|
||||
if (!string.IsNullOrEmpty(_shellSettings.RequestUrlPrefix))
|
||||
_urlPrefix = new UrlPrefix(_shellSettings.RequestUrlPrefix);
|
||||
@@ -51,13 +54,13 @@ namespace Orchard.Mvc.Routes {
|
||||
return null;
|
||||
|
||||
// otherwise wrap handler and return it
|
||||
routeData.RouteHandler = new RouteHandler(_workContextAccessor, routeData.RouteHandler, SessionState);
|
||||
routeData.RouteHandler = new RouteHandler(_workContextAccessor, routeData.RouteHandler, SessionState, _pipeline);
|
||||
routeData.DataTokens["IWorkContextAccessor"] = _workContextAccessor;
|
||||
|
||||
if (IsHttpRoute) {
|
||||
routeData.Values["IWorkContextAccessor"] = _workContextAccessor; // for WebApi
|
||||
}
|
||||
|
||||
|
||||
return routeData;
|
||||
}
|
||||
|
||||
@@ -88,26 +91,30 @@ namespace Orchard.Mvc.Routes {
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IRouteHandler _routeHandler;
|
||||
private readonly SessionStateBehavior _sessionStateBehavior;
|
||||
private readonly Func<IDictionary<string, object>, Task> _pipeline;
|
||||
|
||||
public RouteHandler(IWorkContextAccessor workContextAccessor, IRouteHandler routeHandler, SessionStateBehavior sessionStateBehavior) {
|
||||
public RouteHandler(IWorkContextAccessor workContextAccessor, IRouteHandler routeHandler, SessionStateBehavior sessionStateBehavior, Func<IDictionary<string, object>, Task> pipeline) {
|
||||
_workContextAccessor = workContextAccessor;
|
||||
_routeHandler = routeHandler;
|
||||
_sessionStateBehavior = sessionStateBehavior;
|
||||
_pipeline = pipeline;
|
||||
}
|
||||
|
||||
public IHttpHandler GetHttpHandler(RequestContext requestContext) {
|
||||
var httpHandler = _routeHandler.GetHttpHandler(requestContext);
|
||||
|
||||
requestContext.HttpContext.SetSessionStateBehavior(_sessionStateBehavior);
|
||||
|
||||
|
||||
if (httpHandler is IHttpAsyncHandler) {
|
||||
return new HttpAsyncHandler(_workContextAccessor, (IHttpAsyncHandler)httpHandler);
|
||||
return new HttpAsyncHandler(_workContextAccessor, httpHandler, _pipeline);
|
||||
}
|
||||
|
||||
return new HttpHandler(_workContextAccessor, httpHandler);
|
||||
}
|
||||
}
|
||||
|
||||
class HttpHandler : IHttpHandler, IRequiresSessionState, IHasRequestContext {
|
||||
protected readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IHttpHandler _httpHandler;
|
||||
|
||||
public HttpHandler(IWorkContextAccessor workContextAccessor, IHttpHandler httpHandler) {
|
||||
@@ -133,33 +140,39 @@ namespace Orchard.Mvc.Routes {
|
||||
}
|
||||
}
|
||||
|
||||
class HttpAsyncHandler : HttpHandler, IHttpAsyncHandler {
|
||||
class HttpAsyncHandler : HttpTaskAsyncHandler {
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IHttpAsyncHandler _httpAsyncHandler;
|
||||
private IDisposable _scope;
|
||||
private readonly Func<IDictionary<string, object>, Task> _pipeline;
|
||||
|
||||
public HttpAsyncHandler(IWorkContextAccessor containerProvider, IHttpAsyncHandler httpAsyncHandler)
|
||||
: base(containerProvider, httpAsyncHandler) {
|
||||
_httpAsyncHandler = httpAsyncHandler;
|
||||
public HttpAsyncHandler(IWorkContextAccessor workContextAccessor, IHttpHandler httpHandler, Func<IDictionary<string, object>, Task> env) {
|
||||
_workContextAccessor = workContextAccessor;
|
||||
_httpAsyncHandler = httpHandler as IHttpAsyncHandler;
|
||||
_pipeline = env;
|
||||
}
|
||||
|
||||
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) {
|
||||
_scope = _workContextAccessor.CreateWorkContextScope(new HttpContextWrapper(context));
|
||||
try {
|
||||
return _httpAsyncHandler.BeginProcessRequest(context, cb, extraData);
|
||||
}
|
||||
catch {
|
||||
_scope.Dispose();
|
||||
throw;
|
||||
}
|
||||
public override void ProcessRequest(HttpContext context) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public void EndProcessRequest(IAsyncResult result) {
|
||||
try {
|
||||
_httpAsyncHandler.EndProcessRequest(result);
|
||||
}
|
||||
finally {
|
||||
_scope.Dispose();
|
||||
public override async Task ProcessRequestAsync(HttpContext context) {
|
||||
using (_workContextAccessor.CreateWorkContextScope(new HttpContextWrapper(context))) {
|
||||
|
||||
var environment = context.Items["owin.Environment"] as IDictionary<string, object>;
|
||||
|
||||
if (environment == null) {
|
||||
throw new ArgumentException("owin.Environment can't be null");
|
||||
}
|
||||
|
||||
environment["orchard.Handler"] = new Func<Task>(async () => {
|
||||
await Task.Factory.FromAsync(
|
||||
_httpAsyncHandler.BeginProcessRequest,
|
||||
_httpAsyncHandler.EndProcessRequest,
|
||||
context,
|
||||
null);
|
||||
});
|
||||
|
||||
await _pipeline.Invoke(environment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -86,6 +86,12 @@
|
||||
<HintPath>..\..\lib\log4net\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Owin">
|
||||
<HintPath>..\..\lib\owin\Microsoft.Owin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Host.SystemWeb">
|
||||
<HintPath>..\..\lib\owin\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -101,6 +107,9 @@
|
||||
<Reference Include="NHibernate.SqlAzure">
|
||||
<HintPath>..\..\lib\nhibernate.sqlazure\NHibernate.SqlAzure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Owin">
|
||||
<HintPath>..\..\lib\owin\Owin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
@@ -282,6 +291,10 @@
|
||||
<Compile Include="Mvc\ViewEngines\Razor\IRazorCompilationEvents.cs" />
|
||||
<Compile Include="Mvc\ViewEngines\ThemeAwareness\ThemeViewLocationCache.cs" />
|
||||
<Compile Include="OrchardFatalException.cs" />
|
||||
<Compile Include="Owin\IOwinMiddlewareProvider.cs" />
|
||||
<Compile Include="Owin\OrchardMiddleware.cs" />
|
||||
<Compile Include="Owin\OwinMiddleware.cs" />
|
||||
<Compile Include="Owin\Startup.cs" />
|
||||
<Compile Include="Recipes\Events\IRecipeExecuteEventHandler.cs" />
|
||||
<Compile Include="Recipes\Events\IRecipeSchedulerEventHandler.cs" />
|
||||
<Compile Include="Recipes\Models\Recipe.cs" />
|
||||
|
7
src/Orchard/Owin/IOwinMiddlewareProvider.cs
Normal file
7
src/Orchard/Owin/IOwinMiddlewareProvider.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.Owin {
|
||||
public interface IOwinMiddlewareProvider : IDependency {
|
||||
IEnumerable<OwinMiddleware> GetOwinMiddlewares();
|
||||
}
|
||||
}
|
20
src/Orchard/Owin/OrchardMiddleware.cs
Normal file
20
src/Orchard/Owin/OrchardMiddleware.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Owin;
|
||||
|
||||
namespace Orchard.Owin {
|
||||
public static class OrchardMiddleware {
|
||||
public static IAppBuilder UseOrchard(this IAppBuilder app) {
|
||||
app.Use(async (context, next) => {
|
||||
var handler = context.Environment["orchard.Handler"] as Func<Task>;
|
||||
|
||||
if (handler == null) {
|
||||
throw new ArgumentException("orchard.Handler can't be null");
|
||||
}
|
||||
await handler();
|
||||
});
|
||||
|
||||
return app;
|
||||
}
|
||||
}
|
||||
}
|
9
src/Orchard/Owin/OwinMiddleware.cs
Normal file
9
src/Orchard/Owin/OwinMiddleware.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using Owin;
|
||||
|
||||
namespace Orchard.Owin {
|
||||
public class OwinMiddleware {
|
||||
public Action<IAppBuilder> Configure { get; set; }
|
||||
public string Priority { get; set; }
|
||||
}
|
||||
}
|
12
src/Orchard/Owin/Startup.cs
Normal file
12
src/Orchard/Owin/Startup.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Owin;
|
||||
|
||||
namespace Orchard.Owin {
|
||||
public class Startup {
|
||||
public void Configuration(IAppBuilder app) {
|
||||
app.Use((context, next) => {
|
||||
context.Response.Headers.Append("X-Generator", "Orchard");
|
||||
return next();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user