using System; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; using MySql.Data.EntityFrameworkCore; using Classes; namespace Database { public class DatabaseContext : DbContext { public DatabaseContext() { Details = Task.Run(async () => await DetailsHelper.GetDetails()).GetAwaiter().GetResult(); } public DbSet
Articles; public DbSet Configs; public Dictionary Details; protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseMySQL($"server=localhost;uid={Details["username"]};password={Details["password"]};database=news_aggregator"); } } }