Created
April 3, 2018 20:54
-
-
Save mebjas/c28e7969affd203fc694a6061d07ebb3 to your computer and use it in GitHub Desktop.
md5checkdisbale.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// 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