コード例 #1
0
        protected IServiceCollection GetCollection()
        {
            IServiceCollection service = new ServiceCollection();

            AppBootstraper.InitServices(service);
            //service.AddLogging();
            service.AddMediatR(Assembly.GetExecutingAssembly());


            return(service);
        }
コード例 #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.ConfigureSwagger();
            services.ConfigureAuthentication(Configuration);
            services.AddControllers();
            services.AddTransient <ITokenGenerator, JWTTokenGenerator>();
            services.AddHangfire(x => x.UseSqlServerStorage(Configuration.GetConnectionString("SmartaceDb")));
            services.AddHangfireServer();
            services.AddControllers();
            services.AddDbContext <SmartaceContext>(options =>
                                                    options.UseSqlServer(Configuration.GetConnectionString("SmartaceDb"), b => b.MigrationsAssembly("Smartace.Core")));



            AppBootstraper.InitServices(services);
        }
コード例 #3
0
        private static void BootstrapApp(string connectionString)
        {
            var appBootstraper = new AppBootstraper(new MsSqlConnectionFactory(connectionString));

            appBootstraper.Bootstrap();
        }