コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, StockManagementContext context)
        {
            context.Database.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();

            // global cors policy
            app.UseCors(x => x
                        .AllowAnyOrigin()
                        .AllowAnyMethod()
                        .AllowAnyHeader()
                        .AllowCredentials());

            app.UseAuthentication();
            app.UseMvc();

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
            });
        }
コード例 #2
0
 public UsersController(
     IUserService userService,
     IMapper mapper,
     IOptions <AppSettings> appSettings, StockManagementContext context) : base(context)
 {
     _userService = userService;
     _mapper      = mapper;
     _appSettings = appSettings.Value;
 }
コード例 #3
0
 public CompanyController(StockManagementContext context) : base(context)
 {
     _context = context;
 }
コード例 #4
0
 public StockRepository(StockManagementContext stockManagementContext)
 {
     _stockManagementContext = stockManagementContext;
 }
コード例 #5
0
 public BarcodeController(StockManagementContext context)
 {
     _context = context;
 }
コード例 #6
0
 public ProductController(StockManagementContext context) : base(context)
 {
     _context = context;
 }
コード例 #7
0
 public BalanceController(StockManagementContext context) : base(context)
 {
     _context = context;
 }
コード例 #8
0
 public TransactionController(StockManagementContext context) : base(context)
 {
     _context = context;
 }
コード例 #9
0
 public UserAccessController(StockManagementContext context) : base(context)
 {
     _context = context;
 }
コード例 #10
0
 public UserService(StockManagementContext context)
 {
     _context = context;
 }