Skip to content

Instantly share code, notes, and snippets.

@davidsavagejr
Created July 31, 2012 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidsavagejr/3218858 to your computer and use it in GitHub Desktop.
Save davidsavagejr/3218858 to your computer and use it in GitHub Desktop.
private string GetErrorFromBlob(string blobId)
{
var container = CloudStorageAccount.Parse(this.connectionString).CreateCloudBlobClient().GetContainerReference("elmaherrors");
var blob = container.GetBlobReference(blobId);
return blob.DownloadText();
}
public override ErrorLogEntry GetError(string id)
{
var error = CloudStorageAccount.Parse(connectionString).CreateCloudTableClient().GetDataServiceContext().CreateQuery<ErrorEntity>("elmaherrors").Where(e => e.PartitionKey == string.Empty && e.RowKey == id).Single();
return new ErrorLogEntry(this, id, ErrorXml.DecodeString(GetErrorFromBlob(error.BlobId)));
}
public override int GetErrors(int pageIndex, int pageSize, IList errorEntryList)
{
....
if (!String.IsNullOrEmpty(error.BlobId))
{
var e = ErrorXml.DecodeString(GetErrorFromBlob(error.BlobId));
errorEntryList.Add(new ErrorLogEntry(this, error.RowKey, e));
count += 1;
}
}
return count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment