Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 protected BaseRepository(ProvaFDbContext context)
 {
     _context = context;
 }