public MtxDbContext CreateContext(DbTransaction transaction = null) { var context = new MtxDbContext(new DbContextOptionsBuilder <MtxDbContext>().UseSqlServer(this.Connection).Options); if (transaction != null) { context.Database.UseTransaction(transaction); } return(context); }
public Repository(MtxDbContext mtxDbContext) { this.mtxDbContext = mtxDbContext; this.table = mtxDbContext.Set <T>(); }