// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var dbString = new KerooshaSettings().First(x => x.key == "DbString").value; services.AddMvc().AddJsonOptions(options => { options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; }); services.AddTransient <KerooshaSettings>(); services.AddHangfire(configuration => { configuration.UseStorage(new PostgreSqlStorage(dbString)); }); services.AddEntityFrameworkNpgsql().AddDbContext <MusicContext>(options => { options.UseNpgsql(dbString); }); services.AddCors(); }
public LocalMusicLibrary(MusicContext musicContext) { _appSettings = new KerooshaSettings(); _musicContext = musicContext; }
public ValuesController(KerooshaSettings serverSettings, MusicContext musicContext) { _serverSettings = serverSettings; _musicContext = musicContext; }