示例#1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IShelfService shelfService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseSpaStaticFiles();

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller}/{action=Index}/{id?}");
            });

            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                    spa.UseReactDevelopmentServer(npmScript: "start");
                }
            });

            shelfService.StartShelfService();

            // settings will automatically be used by JsonConvert.SerializeObject/DeserializeObject
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                Formatting       = Formatting.Indented,
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            };
        }
示例#2
0
 public ShelvesController(IAuthorizationService authorizationService,
                          IShelfService shelfService)
 {
     _authorizationService = authorizationService;
     _shelfService         = shelfService;
 }
示例#3
0
 public DriverArrivedHandler(IShelfService shelfService)
 {
     _shelfService = shelfService;
 }
示例#4
0
 public UserCreatedIntegrationEventHandler(IShelfService shelfService,
                                           ILogger <UserCreatedIntegrationEventHandler> logger)
 {
     _shelfService = shelfService;
     _logger       = logger;
 }
示例#5
0
 public ShelfsController(IShelfService shelfService)
 {
     _shelfService = shelfService;
 }
示例#6
0
 public OrderCreatedHandler(IShelfService shelfService)
 {
     _shelfService = shelfService;
 }
示例#7
0
 public ShelfController(IShelfService service)
 {
     _service = service;
 }
 public GetShelvesHandler(IShelfService shelfService)
 {
     _shelfService = shelfService;
 }