public Delegate CreateInvocationDelegate(MethodInfo serviceMethod, ServiceMethodInvocationContext context)
        {
            IServiceMethodInvocation invocation = this.serviceMethodInvocations.FirstOrDefault(x => x.CanCreateInvocationDelegateFor(serviceMethod));

            if (invocation == null)
            {
                throw new ArgumentException(
                          "Method " + serviceMethod + " cannot be invoked as a Service Method as its signature is unknown",
                          "serviceMethod");
            }

            return(invocation.CreateInvocationDelegate(serviceMethod, context));
        }
Exemple #2
0
 public RouteRegistrar(
     RouteTableBuilder routeTableBuilder,
     RouteDispatchBuilder routeDispatchBuilder,
     Func <Type, object> serviceFactory,
     IServiceRequestBinder requestMessageBinder,
     IServiceMethodInvocation serviceMethodInvocation) :
     this(
         routeTableBuilder,
         routeDispatchBuilder,
         builder => builder
         .WithServiceFactory(serviceFactory)
         .WithServiceMethodInvocation(serviceMethodInvocation)
         .WithRequestMessageBinder(requestMessageBinder))
 {
 }
		public RouteRegistrar(
			RouteTableBuilder routeTableBuilder,
			RouteDispatchBuilder routeDispatchBuilder,
			Func<Type, object> serviceFactory,
			IServiceRequestBinder requestMessageBinder,
			IServiceMethodInvocation serviceMethodInvocation):
			this(
				routeTableBuilder,
				routeDispatchBuilder,
				builder => builder
					.WithServiceFactory(serviceFactory)
					.WithServiceMethodInvocation(serviceMethodInvocation)
					.WithRequestMessageBinder(requestMessageBinder))
		{
		}
Exemple #4
0
 public RouteDispatchBuilder WithServiceMethodInvocation(IServiceMethodInvocation serviceMethodInvocation)
 {
     this.dispatchContext.ServiceMethodInvocation = serviceMethodInvocation;
     return(this);
 }
		public RouteDispatchBuilder WithServiceMethodInvocation(IServiceMethodInvocation serviceMethodInvocation)
		{
			this.dispatchContext.ServiceMethodInvocation = serviceMethodInvocation;
			return this;
		}