Interface IProxyEngine
Describes how to wrap a proxy engine to be compatible with this library.
Namespace: Solti.Utils.DI.Interfaces
Assembly: Solti.Utils.DI.Interfaces.dll
Syntax
public interface IProxyEngine
Remarks
The default implementation can be found under the Solti.Utils.DI
namespace which leverages the ProxyGen.NET library.
Methods
CreateActivatorExpression(Type, Expression, Expression, Expression)
Creates an expression that activates the proxy.
Declaration
Expression CreateActivatorExpression(Type proxy, Expression injector, Expression target, Expression interceptorArray)
Parameters
Type | Name | Description |
---|---|---|
System.Type | proxy | The generated proxy type |
System.Linq.Expressions.Expression | injector | The injector to resolve dependencies |
System.Linq.Expressions.Expression | target | The target instance. |
System.Linq.Expressions.Expression | interceptorArray | An array containing all the related IInterfaceInterceptor instance. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression |
Remarks
The returned expression should look like:
new MyProxy(target, interceptorArray)
CreateProxy(Type, Type)
Creates a new proxy type against the given interfacce and target.
Declaration
Type CreateProxy(Type iface, Type target)
Parameters
Type | Name | Description |
---|---|---|
System.Type | iface | |
System.Type | target |
Returns
Type | Description |
---|---|
System.Type |
Remarks
target
may be either the interface itself or a class implementing the interface.