Yes, we did remove IEnumerable from Reliable Collections in the GA release. As Allan T mentions, Reliable Collections aren't really the same as regular .NET collections, even though they represent the same fundamental data structures. One of the big differences you've probably noticed is that all operations are asynchronous, because of locking semantics and I/O for replication and disk reads. It's the latter part that drove the decisions to remove IEnumerable, because it is strictly synchronous and we're not. Instead we now use IAsyncEnumerable, which as of yet does not support the full set of LINQ extension methods.
We're working on asynchronous LINQ extension methods, but in the meantime, there are a couple of ways to work with IAsyncEnumerable.
Eli Arbel has async extension methods on Gist that provide a bridge to System.Interactive.Async and also async implementations of Select, SelectMany, and Where.
Or you can wrap IAsyncEnumerable in a regular IEnumerable that simply wraps the asynchronous calls with synchronous methods, and that will give you the full set of LINQ extensions methods again. Then you can use the extension method in a regular LINQ query:
using (ITransaction tx = this.StateManager.CreateTransaction())
{
var x = from item in (await clusterDictionary.CreateEnumerableAsync(tx)).ToEnumerable()
where item.Value.Status == ClusterStatus.Ready
orderby item.Value.CreatedOn descending
select new ClusterView(
item.Key,
item.Value.AppCount,
item.Value.ServiceCount,
item.Value.Users.Count(),
this.config.MaximumUsersPerCluster,
this.config.MaximumClusterUptime - (DateTimeOffset.UtcNow - item.Value.CreatedOn.ToUniversalTime()));
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…