static void Main(string[] args) { IApplicationHost app = new APCHost(args); app.Init(); app.Run(); }
public CoreDatabaseContext CreateDbContext(string[] args) { var app = new APCHost(args); app.Init(); var ctx = app.Services?.GetRequiredService<CoreDatabaseContext>(); if(ctx != null) { return ctx; } throw new Exception("Coudn't make Aper bot ctx"); }
public SlashDbContext CreateDbContext(string[] args) { var app = new APCHost(args); app.Init(); var ctx = app.Services?.GetRequiredService <IDbContextFactory <SlashDbContext> >(); if (ctx != null) { return(ctx.CreateDbContext()); } throw new Exception("Coudn't make Aper bot ctx"); }