Beispiel #1
0
        public static IConfigurationRoot ConfigureServices(IServiceCollection services)
        {
            // Build configuration
            _configuration = ConfigurationProvider.GetConfiguration();


            //Add dbContext
            services.AddDbContext <AuditorDbContext>(options =>
                                                     options.UseSqlServer(_configuration.GetConnectionString("Default"),
                                                                          x => x.MigrationsAssembly(nameof(DataSource))));

            // Add access to generic IConfigurationRoot
            services.AddSingleton <IConfigurationRoot>(_configuration);


            return(_configuration);
        }