コード例 #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var actionLogDbConnStr = Configuration.GetConnectionString($"{ServiceName}DbConnection");

            services.AddDbContext <IActionLogDbContext, ActionLogDbContext>(options =>
                                                                            BaseDbContextOptions.CreateDbContextOptionsAction(options, actionLogDbConnStr));
            services.AddScoped(typeof(IActionLogRepository), typeof(ActionLogRepository));
            services.AddControllers();
            services.AddSwaggerGen(options =>
            {
                options.SwaggerDoc("v1", new OpenApiInfo
                {
                    Title       = $"{ServiceName} HTTP API",
                    Version     = "v1",
                    Description = ServiceName
                });
            });
        }