public Value[][] Get(GetValue[] valuesToGet)
 {
     var groupedByUri = from x in valuesToGet
                        group x by GetUrl(x.Key);
     var valuesFromEndpoints = new Value[valuesToGet.Length][];
     foreach (var values in groupedByUri)
     {
         var array = values.ToArray();
         var valuesFromCurrentBatch = values.Key.Get(array);
         for (int i = 0; i < array.Length; i++)
         {
             valuesFromEndpoints[Array.IndexOf(valuesToGet, array[i])] = valuesFromCurrentBatch[i];
         }
     }
     return valuesFromEndpoints;
 }
Ejemplo n.º 2
0
 public Value[][] Get(GetValue[] valuesToGet)
 {
     var values = new List<Value[]>();
     hashTable.Batch(actions =>
     {
         foreach (var value in valuesToGet)
         {
             if(value.SpecifiedVersion == null)
             {
                 var version = actions.Get(value.Key);
                 values.Add(version);
             }
             else
             {
                 var version = actions.Get(
                     value.Key,
                     value.SpecifiedVersion.Value);
                 values.Add(new []{version, });
             }
         }
         actions.Commit();
     });
     return values.ToArray();
 }