Click or drag to resize

ServiceHostProxyGenerator Class

Proxy generator used in multitenant service hosting.
Inheritance Hierarchy
SystemObject
  ProxyGenerator
    Autofac.Multitenant.Wcf.DynamicProxyServiceHostProxyGenerator

Namespace:  Autofac.Multitenant.Wcf.DynamicProxy
Assembly:  Autofac.Multitenant.Wcf (in Autofac.Multitenant.Wcf.dll) Version: 4.0.0-CI-234
Syntax
[SecurityCriticalAttribute]
public class ServiceHostProxyGenerator : ProxyGenerator

The ServiceHostProxyGenerator type exposes the following members.

Constructors
  NameDescription
Public methodServiceHostProxyGenerator
Initializes a new instance of the ServiceHostProxyGenerator class.
Top
Properties
  NameDescription
Public propertyLogger (Inherited from ProxyGenerator.)
Public propertyProxyBuilder (Inherited from ProxyGenerator.)
Top
Methods
  NameDescription
Protected methodBuildArgumentListForClassProxy (Inherited from ProxyGenerator.)
Protected methodBuildArgumentListForClassProxyWithTarget (Inherited from ProxyGenerator.)
Protected methodCheckNotGenericTypeDefinition (Inherited from ProxyGenerator.)
Protected methodCheckNotGenericTypeDefinitions (Inherited from ProxyGenerator.)
Public methodCreateClassProxy(Type, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy(Type, Type, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy(Type, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy(Type, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy(Type, ProxyGenerationOptions, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy(Type, Type, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy(Type, Type, ProxyGenerationOptions, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy``1(IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxy``1(ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Protected methodCreateClassProxyInstance (Inherited from ProxyGenerator.)
Protected methodCreateClassProxyType (Inherited from ProxyGenerator.)
Protected methodCreateClassProxyTypeWithTarget (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget(Type, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget(Type, Type, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget(Type, Object, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget(Type, Object, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget(Type, Object, ProxyGenerationOptions, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget(Type, Type, Object, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget(Type, Type, Object, ProxyGenerationOptions, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget``1(UMP, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateClassProxyWithTarget``1(UMP, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Protected methodCreateInterfaceProxyTypeWithoutTarget (Inherited from ProxyGenerator.)
Protected methodCreateInterfaceProxyTypeWithTarget (Inherited from ProxyGenerator.)
Protected methodCreateInterfaceProxyTypeWithTargetInterface (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget(Type, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget(Type, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget(Type, Type, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget(Type, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget(Type, Type, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget``1(IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget``1(IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithoutTarget``1(ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTarget(Type, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTarget(Type, Object, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTarget(Type, Type, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTarget(Type, Type, Object, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTarget``1(UMP, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTarget``1(UMP, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTargetInterface(Type, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTargetInterface(Type, Type, Object, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTargetInterface(Type, Object, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTargetInterface(Type, Type, Object, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTargetInterface``1(UMP, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateInterfaceProxyWithTargetInterface``1(UMP, ProxyGenerationOptions, IInterceptor) (Inherited from ProxyGenerator.)
Public methodCreateWcfProxy
Creates a proxy object that can be used by the WCF service host.
Protected methodCreateWcfProxyType
Creates the WCF service interface proxy type or retrieves it from cache.
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.)
Protected methodGetConstructorArguments (Inherited from ProxyGenerator.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
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.)
Top
Remarks

The WCF service host has very specific requirements around the object type that you pass in when you call CreateServiceHost(Type, Uri).

If you have a type that has a ServiceContractAttribute on it and it implements an interface that has ServiceContractAttribute on it, the WCF service host complains that you can't have two different service contracts.

The proxy generator uses a ServiceHostProxyBuilder to build the proxy types. This is specifically interesting in the CreateWcfProxy(Type, Object) method, which uses some special overrides and additions in the builder.

The builder, when called through CreateWcfProxy(Type, Object), generates proxy types that ignore non-inherited attributes on the service interface (e.g., ServiceContractAttribute) so when the proxy type is generated, it doesn't bring over anything that will cause WCF host initialization to fail or get confused.

See Also