예제 #1
0
        public BaseIntegrationTest()
        {
            var configuration = new ConfigurationBuilder()
                                .SetBasePath(System.IO.Directory.GetCurrentDirectory())
                                .AddJsonFile("appsettings.json", false, true)
                                .Build();

            var serviceProvider = new ServiceCollection()
                                  .AddEntityFrameworkNpgsql()
                                  .BuildServiceProvider();

            var builder = new DbContextOptionsBuilder <ProvaFDbContext>();

            builder.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
            .UseInternalServiceProvider(serviceProvider);

            Context = new ProvaFDbContext(builder.Options);
        }
예제 #2
0
 protected BaseRepository(ProvaFDbContext context)
 {
     _context = context;
 }