Class TypeLookupHandler<TTarget>
  
  Represents a base handler for all handlers that dynamicaly resolve type that performs actual work
 
  
  
    Inheritance
    System.Object
    
    
    
    TypeLookupHandler<TTarget>
      
      
   
  
    Implements
    
    System.IDisposable
    
    
   
  
    Inherited Members
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
   
  
  Assembly: NFX.Wave.dll
  Syntax
  
    public abstract class TypeLookupHandler<TTarget> : WorkHandler, IApplicationComponent, IDisposable, INamed, IOrdered where TTarget : class
   
  Type Parameters
  
  Constructors
  
  
  
  
  TypeLookupHandler(WorkDispatcher, IConfigSectionNode)
  
  
  Declaration
  
    protected TypeLookupHandler(WorkDispatcher dispatcher, IConfigSectionNode confNode)
   
  Parameters
  
  
  
  
  TypeLookupHandler(WorkDispatcher, String, Int32, WorkMatch)
  
  
  Declaration
  
    protected TypeLookupHandler(WorkDispatcher dispatcher, string name, int order, WorkMatch match)
   
  Parameters
  
  Fields
  
  
  
  CONFIG_CLOAK_TYPE_ATTR
  
  
  Declaration
  
    public const string CONFIG_CLOAK_TYPE_ATTR = "cloak-type"
   
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  CONFIG_DEFAULT_TYPE_ATTR
  
  
  Declaration
  
    public const string CONFIG_DEFAULT_TYPE_ATTR = "default-type"
   
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  CONFIG_NOT_FOUND_REDIRECT_URL_ATTR
  
  
  Declaration
  
    public const string CONFIG_NOT_FOUND_REDIRECT_URL_ATTR = "not-found-redirect-url"
   
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  VAR_INSTANCE_ID
  
  
  Declaration
  
    public const string VAR_INSTANCE_ID = "instanceID"
   
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  VAR_TARGET_TYPE
  
  
  Declaration
  
    public const string VAR_TARGET_TYPE = "type"
   
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  Properties
  
  
  
  
  CloakTypeName
  Provides type name which is used if the prior one was not found. This allows to block 404 errors,
i.e. if page with requested name is not found then always return the specified page
 
  
  Declaration
  
    public string CloakTypeName { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  DefaultTypeName
  Provides default type name
 
  
  Declaration
  
    public string DefaultTypeName { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  NotFoundRedirectURL
  Provides redirect URL where the user gets redirected when type name could not be resolved.
Note: CloakTypeName is used first when set.
 
  
  Declaration
  
    public string NotFoundRedirectURL { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  SupportsInstanceID
  Indicates whether instance IDs are supported in requests. Default is false.
Override to return true for handlers that support target instance state between requests
 
  
  Declaration
  
    public virtual bool SupportsInstanceID { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
  
  
  TypeLocations
  Returns a registry of type locations
 
  
  Declaration
  
    public TypeLocations TypeLocations { get; }
   
  Property Value
  
  Methods
  
  
  
  
  CreateTargetInstance(WorkContext, Type)
  Factory method - Override to create and init more particular template implementation (i.e. based on model)
 
  
  Declaration
  
    protected virtual TTarget CreateTargetInstance(WorkContext work, Type tt)
   
  Parameters
  
  Returns
  
  
  
  
  DeleteTargetInstanceByID(WorkContext, Guid)
  Deletes target instance with id from store. Default implementation uses Application.ObjectStore.
 
  
  Declaration
  
    protected virtual void DeleteTargetInstanceByID(WorkContext work, Guid id)
   
  Parameters
  
  
  
  
  Do404(WorkContext)
  Override to handle 404 condition, i.e. may write into response instead of generating a exception.
The default implementation returns a HttpStatusException with 404 code
 
  
  Declaration
  
    protected virtual HTTPStatusException Do404(WorkContext context)
   
  Parameters
  
  Returns
  
  
  
  
  DoError(WorkContext, Exception)
  Override to handle error processing, i.e. may elect to write error data into response.
The dafault implementation throws the error. It is recommended to handle errors with filters instead
 
  
  Declaration
  
    protected virtual void DoError(WorkContext work, Exception error)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | WorkContext | 
        work | 
         | 
      
      
        | System.Exception | 
        error | 
         | 
      
    
  
  
  
  
  DoHandleWork(WorkContext)
  Sealed. Override DoTargetWork(TTarget, WorkContext) to do actual work
 
  
  Declaration
  
    protected override sealed void DoHandleWork(WorkContext work)
   
  Parameters
  
  Overrides
  
  
  
  
  DoTargetWork(TTarget, WorkContext)
  Performs work on the target instance
 
  
  Declaration
  
    protected abstract void DoTargetWork(TTarget target, WorkContext work)
   
  Parameters
  
  
  
  
  GetTargetInstanceByID(WorkContext, Guid)
  Retrieves target instance from id. Default implementation uses Application.ObjectStore.
If this method is called by the framework then complementary matching PutTargetInstanceWithID() is guaranteed to be called as well
 
  
  Declaration
  
    protected virtual TTarget GetTargetInstanceByID(WorkContext work, Guid id)
   
  Parameters
  
  Returns
  
  
  
  
  GetTargetInstanceID(WorkContext, ref Guid)
  Override to extract instance ID from WorkContext
 
  
  Declaration
  
    protected virtual bool GetTargetInstanceID(WorkContext work, ref Guid id)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
  
  
  GetTargetType(WorkContext)
  Override to resolve route/URL parameters to type
 
  
  Declaration
  
    protected virtual Type GetTargetType(WorkContext work)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Type | 
         | 
      
    
  
  
  
  
  GetTargetTypeNameFromWorkContext(WorkContext)
  Override to get type name from WorkContext. Default implementation looks for MatchedVars[VAR_TARGET_TYPE]
 
  
  Declaration
  
    protected virtual string GetTargetTypeNameFromWorkContext(WorkContext work)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  PutTargetInstanceByID(WorkContext, Guid, TTarget, Int32)
  Puts target instance with id into store. Default implementation uses Application.ObjectStore.
This method is called by the framework to complement GetTargetInstanceFromID()
 
  
  Declaration
  
    protected virtual void PutTargetInstanceByID(WorkContext work, Guid id, TTarget target, int msTimeout = 0)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | WorkContext | 
        work | 
         | 
      
      
        | System.Guid | 
        id | 
         | 
      
      
        | TTarget | 
        target | 
         | 
      
      
        | System.Int32 | 
        msTimeout | 
         | 
      
    
  
  Implements
  
  
      System.IDisposable
  
  
  
  Extension Methods