Skip to content

Instantly share code, notes, and snippets.

@sippylabs
sippylabs / Context.cs
Last active August 29, 2015 14:13 — forked from Deathspike/Context.cs
Modified for EF5+
public class Context : IContext
{
public readonly ServiceEntities _entities;
#region Constructor
public Context()
{
_entities = new ServiceEntities();
}
public class Context : IContext
{
public readonly ServiceEntities _entities;
#region Constructor
public Context()
{
_entities = new ServiceEntities();
}
@sippylabs
sippylabs / wat.cs
Last active October 20, 2015 16:22
wat
terms = terms.Replace("-", " "); // e.g, "Berwick-upon-Tweed" => "Berwick upon Tweed"
terms = terms.ToAlphanumericOrWhitespace(); // remove all other apostrophes etc
List<string> parts = null;
var sb = new StringBuilder();
bool haveAppendedWord = false;
IEnumerable<string> TermsSplitBySpace = terms.SplitByDelimiter(' ');
if (TermsSplitBySpace != null)
{
parts = TermsSplitBySpace.ToList();