Esempio n. 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();
            }
        }
Esempio n. 2
0
 public CRUDService(BooksSQLiteContext context)
 {
     db = context;
 }
Esempio n. 3
0
 public SearchService(BooksSQLiteContext context, IPopularityService _service)
 {
     db = context;
     _popularityService = _service;
 }
Esempio n. 4
0
 public PopularityService(BooksSQLiteContext context)
 {
     db = context;
 }