public TResult Query<TResult>(Func<IEnumerable<User>, TResult> action) { lock (this.lockObj) { return action(EnumerableEx.Create(() => this.collection.GetEnumerator())); } }