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
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
//Create Client | |
//Create Database | |
//Create Collection | |
//Create Document(s) | |
//Query Document | |
//Delete Database |
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
await client.DeleteDatabaseAsync(UriFactory.CreateDatabaseUri(dbName)); |
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
//Query Document | |
Volcano rainierVolcano = client.CreateDocumentQuery<Volcano>( | |
UriFactory.CreateDocumentCollectionUri(dbName,collectionName)) | |
.Where(v => v.VolcanoName == "Rainier") | |
.AsEnumerable() | |
.FirstOrDefault(); |
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
//create document | |
var volcano = new Volcano | |
{ | |
VolcanoName = "Rainier", | |
Country = "United States", | |
Region = "US-Washington", | |
Location = new Location | |
{ | |
Type = "Point", | |
Coordinates = new double[] { -121.758, 46.87 } |
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
//Create Collection | |
var collection = await client.CreateDocumentCollectionIfNotExistsAsync( | |
UriFactory.CreateDatabaseUri(dbName), | |
new DocumentCollection { Id = collectionName } | |
); |
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
//Create Database | |
var database = await client.CreateDatabaseIfNotExistsAsync( | |
new Database { Id = dbName }); |
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
string endpointUri = "https://localhost:8081"; | |
string authKey = "<auth key>"; | |
string dbName = "VolcanoesDB"; | |
string collectionName = "Volcanoes"; | |
using (DocumentClient client = new DocumentClient(new Uri(endpointUri), authKey)) | |
{ | |
//... | |
} |
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
<script> | |
function createChart() { | |
$("#chart").kendoChart({ | |
title: { | |
text: "Gross domestic product growth \n (GDP annual %)" | |
}, | |
seriesColors:['#b71c1c','#1a237e','#004d40'], | |
//ommitted for brevity... | |
}); | |
} |
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
<script> | |
function createChart() { | |
$("#chart").kendoChart({ | |
title: { | |
text: "Gross domestic product growth \n (GDP annual %)" | |
}, | |
seriesDefaults: { | |
type: "area", | |
area: { | |
line: { |
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
<div id="chart"></div> |
NewerOlder