public async Task <Document> GetDoc(DocCollection dc, string id) { var doc = await this.docClient.ReadDocumentAsync(dc, id); return(doc); }
public static Uri ToDocUri(this DocCollection dc, string docId) => UriFactory.CreateDocumentUri(DocDbNames.DbName, collectionMap[dc], docId);
public static Uri ToDocCollectionUri(this DocCollection dc) => UriFactory.CreateDocumentCollectionUri(DocDbNames.DbName, collectionMap[dc]);
public static async Task <Document> ReadDocumentAsync(this DocumentClient docClient, DocCollection dc, string docId) { return(await docClient.ReadDocumentAsync(dc.ToDocUri(docId))); }
public static async Task <Document> UpsertDocumentAsync <T>(this DocumentClient docClient, DocCollection dc, T document) where T : IIdentifiableItem { return(await docClient.UpsertDocumentAsync(dc.ToDocUri(document.Id), document)); }
public static async Task <Document> CreateDocumentAsync(this DocumentClient docClient, DocCollection dc, object document) { return(await docClient.CreateDocumentAsync(dc.ToDocCollectionUri(), document)); }