Skip to content

Instantly share code, notes, and snippets.

View SimonDoy's full-sized avatar

Simon Doy SimonDoy

View GitHub Profile
$sometext = "#;FirstName LastName";
$regex = "(#;)";
[System.Text.RegularExpressions.Regex]::Replace($sometext, $regex, "");
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="documentDb:Endpoint" value="https://{url}.documents.azure.com:443/"/>
<add key="documentDb:PrimaryKey" value={primarykey}
<add key="documentDb:SecondaryKey" value="{secondarykey}
<add key="documentDb:DatabaseName" value="invoicedatabase" />
<add key="documentDb:DocumentCollectionName" value="invoicesdocumentcollection" />
</appSettings>
private IOrderedQueryable<InvoiceForm> GetAllQuery()
{
var feedOptions = new FeedOptions { MaxItemCount = -1 };
var documentCollectionUri = new Uri(_dataContext.DocumentCollection.DocumentCollection.AltLink, UriKind.RelativeOrAbsolute);
var query = _dataContext.Database.Client.CreateDocumentQuery<InvoiceForm>(documentCollectionUri, feedOptions);
return query;
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using Itsp365.InvoiceFormApp.Api.Models.Entities;
using Itsp365.InvoiceFormApp.Api.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Itsp365.InvoiceFormApp.Api.Models.Entities;
using ITSP365.InvoiceFormApp.Api.DataAccess;
using Microsoft.ApplicationInsights;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;
@SimonDoy
SimonDoy / InvoiceDataContext.cs
Created May 24, 2016 20:29
initial implementation of InvoiceDataContext
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
namespace ITSP365.InvoiceFormApp.Api.DataAccess
{
public class InvoiceDataContext
{
@SimonDoy
SimonDoy / InvoiceDocumentCollection.cs
Created May 24, 2016 20:28
Initial implementation of document collection for azure documentdb
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Web;
namespace ITSP365.InvoiceFormApp.Api.DataAccess
@SimonDoy
SimonDoy / InvoiceDatabase.cs
Created May 24, 2016 20:25
Implementation of InvoiceDatabase object
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights;
@SimonDoy
SimonDoy / DatabaseConfig.cs
Created May 24, 2016 20:20
The initial database configuration file
using System.Collections.Specialized;
using System.Configuration;
using System.Linq;
namespace ITSP365.InvoiceFormApp.Api.DataAccess
{
internal class DatabaseConfig
{
internal string DatabaseEndPoint {
get
<div class="container">
<div class="row">
<div class="col-md-4 col-sd-12">
<button class="btn btn-default" type="button" title="Save" ng-click="saveInvoice()">Save</button>
&nbsp;
<button class="btn" type="button" title="Cancel" ng-click="cancel()">Cancel</button>
</div>
<div class="col-md-8 col-sd-12">
<span ng-show="status !== ''">{{status}}</span>