Click or drag to resize

ContextAsyncTHierarchyItem Class

IT Hit WebDAV Classes Reference
This class represents an execution context. Holds request, response, and resolves hierarchy items by paths.
Inheritance Hierarchy

Namespace:  ITHit.Server
Assembly:  ITHit.Server (in ITHit.Server.dll) Version: 13.3.13068
public abstract class ContextAsync<THierarchyItem>
where THierarchyItem : IHierarchyItemBase

Type Parameters

Type implements IHierarchyItemBase

The ContextAsyncTHierarchyItem type exposes the following members.

Public propertyEngine
Instance of Engine which is currently executing the request.
Public propertyException
Exception which occurred during request execution.
Public propertyRequest
Object representing current request.
Public propertyResponse
Object representing current response.
Public methodBeforeResponseAsync
This method is called right before engine starts writing response.
Public methodEnsureBeforeResponseWasCalledAsync
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetHierarchyItemAsync
Implementation of this abstract method is used by the engine to find hierarchy item objects by path.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
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, ContextWebAsyncTHierarchyItem, 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.

Thread Safety
Instance members of this class are NOT thread-safe. You must create a separate instance of this class for each request.
See Also