示例#1
0
        static void Main(string[] args)
        {
            IApplicationHost app = new APCHost(args);

            app.Init();
            app.Run();
        }
示例#2
0
        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");
        }
示例#3
0
        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");
        }