public abstract class ContextAsync<THierarchyItemAsync> where THierarchyItemAsync : IHierarchyItemBaseAsync
Public MustInherit Class ContextAsync(Of THierarchyItemAsync As IHierarchyItemBaseAsync)
generic<typename THierarchyItemAsync> where THierarchyItemAsync : IHierarchyItemBaseAsync public ref class ContextAsync abstract
[<AbstractClassAttribute>] type ContextAsync<'THierarchyItemAsync when 'THierarchyItemAsync : IHierarchyItemBaseAsync> = class end
Thetype exposes the following members.
Instance of Engine which is currently executing the request.
Exception which occurred during request execution.
Object representing current request.
Object representing current response.
This method is called right before engine starts writing response.
Calls BeforeResponseAsync only first time this method is invoked.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function.(Inherited from Object.)
Implementation of this abstract method is used by the engine to find hierarchy item objects by path.
Gets the Type of the current instance.(Inherited from Object.)
Creates a shallow copy of the current Object.(Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
This class provides the engine with information about currently executing context. It holds request, response and provides item factory method GetHierarchyItemAsync(String) to resolve items by path.
The library provides a set of context classes derived from this class, that provide constructors for .NET Core, ASP.NET, HttpLitener and other environments. Typically you will not derive your class directly from this class. Instead, you will derive your class from one of the context classes designed for your environment, such as ContextCoreAsyncTHierarchyItemAsync, ContextWebAsyncTHierarchyItemAsync, etc.
When inheriting you must implement the GetHierarchyItemAsync(String) method. In this method, you will search for items (files, folders, versions, etc.) in your storage by path provided and return it to the engine.
In each HTTP request you will create a separate instance of your class and pass it to RunAsync(ContextAsyncTHierarchyItemAsync) method.
You can implement your own request and response classes to run the engine in virtually any hosting environment.