Ejemplo n.º 1
0
 /// <summary>
 /// This will build a proxy for the interface representing the gateway and register the 
 /// proxy instance in the container based on the definition.
 /// </summary>
 /// <param name="container"><seealso cref="IContainer"/></param>
 /// <param name="gatewayDefinition">Definition of the gateway</param>
 public void BuildProxy(IObjectBuilder container, IGatewayDefinition gatewayDefinition)
 {
     var methodInterceptor = new GatewayMethodInterceptor(container, gatewayDefinition);
     var gatewayInstance = container.Resolve<IReflection>().GetTypeForNamedInstance(gatewayDefinition.Contract);
     var proxy = BuildFor(gatewayInstance, methodInterceptor);
     container.Register(gatewayDefinition.Id, gatewayInstance, proxy);
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Registers the specified types.
 /// </summary>
 /// <param name="types">The types.</param>
 public void Register(IEnumerable <Type> types)
 {
     _objectBuilder.Register(types);
 }