public static DocumentCollection GetOrCreateCollection(string databaseLink, string collectionId)
{
var col = Client.CreateDocumentCollectionQuery(databaseLink)
.Where(c => c.Id == collectionId)
.AsEnumerable()
.FirstOrDefault();
if (col == null)
{
col = client.CreateDocumentCollectionAsync(databaseLink,
new DocumentCollection { Id = collectionId },
new RequestOptions { OfferType = "S1" }).Result;
}
return col;
}