Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public CrowRouteHandler(BusinessInvoker handler)
 {
     _Handler = handler;
 }
Ejemplo n.º 3
0
 public CrowBusinessAsyncHandler(BusinessInvoker handler)
 {
     _Handler = handler;
 }
Ejemplo n.º 4
0
 /// <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);
 }