Click or drag to resize

AutofacWebTypesModule Class

Dependency injection module that registers abstractions for common web application properties.
Inheritance Hierarchy
SystemObject
  AutofacModule
    Autofac.Integration.MvcAutofacWebTypesModule

Namespace:  Autofac.Integration.Mvc
Assembly:  Autofac.Integration.Mvc (in Autofac.Integration.Mvc.dll) Version: 6.0.0+106fe194fc419c09f32d39119967f68798cc6895
Syntax
public class AutofacWebTypesModule : Module

The AutofacWebTypesModule type exposes the following members.

Constructors
  NameDescription
Public methodAutofacWebTypesModule
Initializes a new instance of the AutofacWebTypesModule class
Top
Properties
  NameDescription
Protected propertyThisAssembly
Gets the assembly in which the concrete module type is located. To avoid bugs whereby deriving from a module will change the target assembly, this property can only be used by modules that inherit directly from Module.
(Inherited from Module.)
Top
Methods
  NameDescription
Protected methodAttachToComponentRegistration
Override to attach module-specific functionality to a component registration.
(Inherited from Module.)
Protected methodAttachToRegistrationSource
Override to perform module-specific processing on a registration source.
(Inherited from Module.)
Public methodConfigure
Apply the module to the component registry.
(Inherited from Module.)
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 methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodLoad
Registers web abstractions with dependency injection.
(Overrides ModuleLoad(ContainerBuilder).)
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.)
Top
Remarks

This Module is primarily used during application startup (in Global.asax) to register mappings from commonly referenced contextual application properties to their corresponding abstraction.

The following mappings are made:

Common ConstructAbstraction
HttpContext.CurrentHttpContextBase
HttpContext.Current.ApplicationHttpApplicationStateBase
HttpContext.Current.RequestHttpRequestBase
HttpContext.Current.Request.BrowserHttpBrowserCapabilitiesBase
HttpContext.Current.Request.FilesHttpFileCollectionBase
HttpContext.Current.Request.RequestContextRequestContext
HttpContext.Current.ResponseHttpResponseBase
HttpContext.Current.Response.CacheHttpCachePolicyBase
HttpContext.Current.ServerHttpServerUtilityBase
HttpContext.Current.SessionHttpSessionStateBase
HostingEnvironment.VirtualPathProviderVirtualPathProvider

In addition, the UrlHelper type is registered for construction based on the current RequestContext.

The lifetime for each of these items is one web request.

See Also