Skip to content

Instantly share code, notes, and snippets.

View dontpaniclabsgists's full-sized avatar

Don't Panic Labs dontpaniclabsgists

View GitHub Profile
public int Count()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var count = client.CreateDocumentQuery<Note>(
link,
new FeedOptions()
{
public int CountSql()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var count = client.CreateDocumentQuery<int>(
link,
"select value count(1) from notes",
new FeedOptions()
public async Task<Note[]> All()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var query = client.CreateDocumentQuery<Note>(
link,
new FeedOptions()
{
public async Task<Note[]> AllSql()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var query = client.CreateDocumentQuery<Note>(link,
"select * from notes",
new FeedOptions()
{
using Microsoft.Azure.Documents.Client;
using Microsoft.Azure.Documents.Linq;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CosmosTest
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CosmosTest
{
class Program
@dontpaniclabsgists
dontpaniclabsgists / azure_functions_1_1.html
Last active August 25, 2017 15:03
azure_functions_1_1
<html>
<body>
<div>Hello</div>
</body>
</html>
using System.Net;
 
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
    log.Info("C# HTTP trigger function processed a request.");
 
    // parse query parameter
    string name = req.GetQueryNameValuePairs()
        .FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0)
        .Value;
const appRoutes: Routes = [
{
path: 'about',
component: AboutComponent
},
{
path: '**',
component: HomeComponent
}
];
@NgModule({
declarations: [
AppComponent,
AboutComponent,
HomeComponent
],
imports: [
BrowserModule,
RouterModule.forRoot(
appRoutes,