var objectContext = ((IObjectContextAdapter)dbContext).ObjectContext;
var refreshableObjects = objectContext.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Deleted | EntityState.Modified | EntityState.Unchanged).Where(x => entityType == null || x.Entity.GetType() == entityType).Where(entry => entry.EntityKey != null).Select(e => e.Entity).ToArray();
objectContext.Refresh(RefreshMode.StoreWins, refreshableObjects);