Exemplo n.º 1
0
        public ApiRepositoryContext Build()
        {
            var connection = new SqlConnection(_connectionStringProvider.GetConnectionString());
            var context    = new ApiRepositoryContext(new DbContextOptionsBuilder <ApiRepositoryContext>().UseSqlServer(connection).Options);

            return(context);
        }
 public void ResetContext()
 {
     _context = _contextFactory.Build();
 }
 public ApiRepository(IApiRepositoryContextFactory contextFactory)
 {
     _contextFactory = contextFactory;
     _context        = _contextFactory.Build();
 }