public static RouteBase MapBusiness(this RouteCollection routes, string url, IInjectionContainer container) { INamingConvention convention = container.Resolve<INamingConvention>(); BusinessInvoker invoker = new BusinessInvoker(AspNetRoutedHost.HostList, convention, container); string routeUrl = url; if (!routeUrl.EndsWith("/")) { routeUrl += "/{*operation}"; } routeUrl = routeUrl.TrimStart('~').TrimStart('/'); var route = new Route(routeUrl, new CrowRouteHandler(invoker)); routes.Add("Crow", route); return route; }
public CrowRouteHandler(BusinessInvoker handler) { _Handler = handler; }
public CrowBusinessAsyncHandler(BusinessInvoker handler) { _Handler = handler; }
/// <summary> /// Send an HTTP request as an asynchronous operation. /// </summary> protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { BusinessInvoker invoker = new BusinessInvoker(_host, _convention, _container); return invoker.Invoke(request); }