public static bool Any <T>(this IGetStatisticsGrain <T> src, Func <T, bool> func)
            where T : DataChunk
        {
            var task = src.GetAllSerialized();

            task.Wait();

            return(JsonConvert.DeserializeObject <ICollection <T> >(task.Result).Any(x => func(x)));
        }
 public static async Task <IEnumerable <T> > Where <T>(this IGetStatisticsGrain <T> src, Func <T, bool> func)
     where T : DataChunk
 => (JsonConvert.DeserializeObject <ICollection <T> >(await src.GetAllSerialized())).Where(x => func(x));
 public static async Task <bool> AnyAsync <T>(this IGetStatisticsGrain <T> src, Func <T, bool> func)
     where T : DataChunk
 => JsonConvert.DeserializeObject <ICollection <T> >(await src.GetAllSerialized()).Any(x => func(x));
 public static async Task <ICollection <T> > GetLastN <T>(this IGetStatisticsGrain <T> src, Func <T, bool> func, int elems)
     where T : DataChunk
 => JsonConvert.DeserializeObject <ICollection <T> >(await src.GetAllSerialized())?.Where(x => func(x)).TakeLast(elems).ToArray();