public static async Task <T> ReadAsJsonAsync <T>(this BlobInfo self, StateMachineBase stm) { if (self == null) { throw new ArgumentNullException("self"); } return(JsonConvert.DeserializeObject <T>(await self.ReadAllTextAsync(stm))); }
public static async Task <string> ReadAllTextAsync(this BlobInfo self, StateMachineBase stm) { if (self == null) { throw new ArgumentNullException("self"); } var blobs = await stm.Store.ReadBlobs(new[] { self }); return(Encoding.UTF8.GetString(blobs.First().Item2)); }
public static async Task <byte[]> ReadAllBytesAsync(this BlobInfo self, StateMachineBase stm) { if (self == null) { throw new ArgumentNullException("self"); } var blobs = await stm.Store.ReadBlobs(new[] { self }); return(blobs.First().Item2); }