Пример #1
0
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(env.ContentRootPath)
                          .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                          .AddEnvironmentVariables();

            Configuration = builder.Build();

            //add for SQLite db:
            using (var db = new BooksSQLiteContext())
            {
                db.Database.EnsureCreated();
                db.Database.Migrate();
            }
        }
Пример #2
0
 public CRUDService(BooksSQLiteContext context)
 {
     db = context;
 }
Пример #3
0
 public SearchService(BooksSQLiteContext context, IPopularityService _service)
 {
     db = context;
     _popularityService = _service;
 }
Пример #4
0
 public PopularityService(BooksSQLiteContext context)
 {
     db = context;
 }