Skip to content

Instantly share code, notes, and snippets.

View lohithgn's full-sized avatar

Lohith lohithgn

View GitHub Profile
class Program
{
static async Task Main(string[] args)
{
//Create Client
//Create Database
//Create Collection
//Create Document(s)
//Query Document
//Delete Database
await client.DeleteDatabaseAsync(UriFactory.CreateDatabaseUri(dbName));
//Query Document
Volcano rainierVolcano = client.CreateDocumentQuery<Volcano>(
UriFactory.CreateDocumentCollectionUri(dbName,collectionName))
.Where(v => v.VolcanoName == "Rainier")
.AsEnumerable()
.FirstOrDefault();
//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 }
//Create Collection
var collection = await client.CreateDocumentCollectionIfNotExistsAsync(
UriFactory.CreateDatabaseUri(dbName),
new DocumentCollection { Id = collectionName }
);
//Create Database
var database = await client.CreateDatabaseIfNotExistsAsync(
new Database { Id = dbName });
string endpointUri = "https://localhost:8081";
string authKey = "<auth key>";
string dbName = "VolcanoesDB";
string collectionName = "Volcanoes";
using (DocumentClient client = new DocumentClient(new Uri(endpointUri), authKey))
{
//...
}
@lohithgn
lohithgn / kendouichart_3.html
Created November 22, 2016 07:35
Kendo UI Chart - custom series colors
<script>
function createChart() {
$("#chart").kendoChart({
title: {
text: "Gross domestic product growth \n (GDP annual %)"
},
seriesColors:['#b71c1c','#1a237e','#004d40'],
//ommitted for brevity...
});
}
@lohithgn
lohithgn / kendouichart_2.html
Created November 22, 2016 07:16
Kendo UI Chart - instantiatig the chart
<script>
function createChart() {
$("#chart").kendoChart({
title: {
text: "Gross domestic product growth \n (GDP annual %)"
},
seriesDefaults: {
type: "area",
area: {
line: {
@lohithgn
lohithgn / kendouichart.html
Created November 22, 2016 07:14
Kendo UI Data Viz - Chart
<div id="chart"></div>