Exemplo n.º 1
0
        public AppDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <AppDbContext>();
            var configuration = AppConfig.Get(FolderFinder.FetchRoot());

            DbContextConfigurer.Configure(builder, configuration.GetConnectionString(AppConsts.ConnectionStringName));

            return(new AppDbContext(builder.Options));
        }
Exemplo n.º 2
0
        public static DbContextOptions <AppDbContext> Get()
        {
            var configuration = AppConfig.Get(FolderFinder.FetchRoot());

            var builder = new DbContextOptionsBuilder <AppDbContext>();

            DbContextConfigurer.Configure(builder, configuration.GetConnectionString(AppConsts.ConnectionStringName));

            return(builder.Options);
        }