Last active
March 14, 2016 22:34
-
-
Save EricAtMSFT/9ab38451139d177c37d4 to your computer and use it in GitHub Desktop.
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
// Stored Procedures | |
private const string TransferGoldStoredProcedureScriptFileName = @"Models\DocumentDB\js\transferGoldStoredProcedure.js"; | |
private const string TransferGoldStoredProcedureId = "transferGold"; | |
private const string GetRecentPhotosForCategoriesStoredProcedureScriptFileName = @"Models\DocumentDB\js\getRecentPhotosForCategoriesStoredProcedure.js"; | |
private const string GetRecentPhotosForCategoriesStoredProcedureId = "getRecentPhotosForCategories"; | |
private async Task InitializeStoredProceduresInDocumentDb() | |
{ | |
// Initialize GoldTransaction Sproc | |
var sproc = new StoredProcedure | |
{ | |
Id = TransferGoldStoredProcedureId, | |
Body = File.ReadAllText(TransferGoldStoredProcedureScriptFileName) | |
}; | |
await _documentClient.UpsertStoredProcedureAsync(DocumentCollectionUri, sproc); | |
// Initialize GetCategoriesPreview Sproc | |
sproc = new StoredProcedure | |
{ | |
Id = GetRecentPhotosForCategoriesStoredProcedureId, | |
Body = File.ReadAllText(GetRecentPhotosForCategoriesStoredProcedureScriptFileName) | |
}; | |
await _documentClient.UpsertStoredProcedureAsync(DocumentCollectionUri, sproc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment