Instantly share code, notes, and snippets.

Embed
What would you like to do?
md5checkdisbale.cs
//// Upload data to blob
public void UploadData(DataModel data, string blobName) {
BlobRequestOptions blobRequestOption = new BlobRequestOptions()
{
DisableContentMD5Validation = false
};
//// define cloudBlobContainer above
CloudBlockBlob blockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);
blockBlob.UploadText(
JsonConvert.SerializeObject(data),
options: blobRequestOption);
}
//// Upload data to blob
public DataModel DownloadData(string blobName) {
BlobRequestOptions blobRequestOption = new BlobRequestOptions()
{
DisableContentMD5Validation = false
};
//// define cloudBlobContainer above
CloudBlockBlob blockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);
string data = blockBlob.DownloadText(options: blobRequestOption);
return JsonConvert.DeserializeObject<DataModel>(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment