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 Database : DbContext { public Database() { Details = Task.Run(async () => await DetailsHelper.GetDetails()).GetAwaiter().GetResult(); } public DbSet
Articles; public DbSet Configs; public static Dictionary Details; protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseMySQL($"server=localhost;uid={Details["username"]};password={Details["password"]};database=news_aggregator"); } } }