コード例 #1
0
 public ProductCountViewComponent(IRestClient restClient, IMapper mapper, UserManager <SiteUser> userManager
                                  , RoutingConfig routingConfig, IHttpContextAccessor contextAccessor)
 {
     this.restClient      = restClient;
     this.mapper          = mapper;
     this.userManager     = userManager;
     this.routingConfig   = routingConfig;
     this.contextAccessor = contextAccessor;
 }
コード例 #2
0
        public ShoppingCartService(IRestClient restClient, IMapper mapper
                                   , RoutingConfig routingConfig, UserManager <SiteUser> userManager, IHttpContextAccessor contextAccessor, AnoymousIdHandler anonHandler)

        {
            this.restClient      = restClient;
            this.mapper          = mapper;
            this.routing         = routingConfig.ShoppingCartService;
            this.contextAccessor = contextAccessor;
            this.anonHandler     = anonHandler;
            this.userManager     = userManager;
        }
コード例 #3
0
        public void Configure(
            IApplicationBuilder app,
            IWebHostEnvironment env
            )
        {
            ExceptionConfig.Apply(app, env, Configuration);

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();

            RoutingConfig.Apply(app, env, Configuration);
        }
コード例 #4
0
        public static void Register(HttpConfiguration config)
        {
            //var cors = new EnableCorsAttribute("*", "*", "*");
            //config.EnableCors(cors);

            MediaTypeFormattingConfig.Configure(config);
            RoutingConfig.Configure(config);
            IoCConfig.Configure(config);
            TracingConfig.Configure(config, IoCConfig.Container);
            LoggingConfig.Configure();
            ExceptionHandlingConfig.Configure(config);
            ValidationConfig.Configure(config);
            LocalizationConfig.Configure(config);

            //configure authentication
            config.MessageHandlers.Insert(0, new AuthenticationHandler());

            //for gzip compression use:
            // config.MessageHandlers.Insert(0, new ServerCompressionHandler(new GZipCompressor(), new DeflateCompressor()));
        }
コード例 #5
0
        static void Main(string[] args)
        {
            var requestDispatcher = new RequestDispatcher();

            var routingConfig        = new RoutingConfig();
            var createCutomerCommand = new CreateCustomerCommand();

            routingConfig.Register(createCutomerCommand.MessageType, new Tuple <Parse, DispatchCommand>(createCutomerCommand.Parse, requestDispatcher.CreateCustomer));

            var placeOrderCommand = new PlaceOrderCommand();

            routingConfig.Register(placeOrderCommand.MessageType,
                                   new Tuple <Parse, DispatchCommand>(placeOrderCommand.Parse, requestDispatcher.PlaceOrder));

            var routeDispatcher = new RouteDispatcher(routingConfig);

            var server = new SocketServer(new IPEndPoint(IPAddress.Loopback, 11000),
                                          routeDispatcher.Dispatch);

            server.StartListening();

            Console.ReadKey();
        }
コード例 #6
0
 public ProductService(IRestClient client, RoutingConfig routingConfig)
 {
     this.client  = client;
     this.routing = routingConfig.ProductService;
 }
コード例 #7
0
 public OrderPurchaseViewComponent(IOrderRestService restClient, RoutingConfig routingConfig, IMapper mapper)
 {
     this.restClient    = restClient;
     this.routingConfig = routingConfig;
     this.mapper        = mapper;
 }
コード例 #8
0
 public OrderRestService(IRestClient client, RoutingConfig routingConfig, IMapper mapper)
 {
     this.client        = client;
     this.routingConfig = routingConfig.OrderService;
     this.mapper        = mapper;
 }
コード例 #9
0
 public CustomerRestService(IRestClient client, RoutingConfig routingConfig, IMapper mapper)
 {
     this.client        = client;
     this.routingConfig = routingConfig;
     this.mapper        = mapper;
 }
コード例 #10
0
 public OrderConfirmationViewComponent(IRestClient restClient, RoutingConfig routingConfig, IMapper mapper)
 {
     this.restClient    = restClient;
     this.routingConfig = routingConfig;
     this.mapper        = mapper;
 }