public TDbContext Get <TDbContext>() where TDbContext : DbContext
        {
            var ambientDbContextScope = DbContextScope.GetAmbientScope();

            return(ambientDbContextScope == null
                ? null
                : ambientDbContextScope.DbContexts.Get <TDbContext>());
        }
 public AmbientContextSuppressor()
 {
     _savedScope = DbContextScope.GetAmbientScope();
     DbContextScope.HideAmbientScope();
 }