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
public class Wireup | |
{ | |
public void DoWireup() | |
{ | |
var identity = new IdentityFormatter(); | |
var stringFormat = new FormattingStringFormatter(); | |
// that would normally get registered in your container or what not. | |
Selectors = new[] | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Nancy; | |
using Nancy.Owin; | |
using Nowin; |
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
public class cappedqueue : cappedcontext | |
{ | |
static object[] examples = | |
{ | |
new { members = new[] { 1, 2, 3, 4 }, cap = 3, expected = new[] { 2, 3, 4 } } | |
}; | |
public cappedqueue(int[] members, int cap) | |
{ |
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
using System; | |
using System.Collections; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using MongoDB.Bson.Serialization.Attributes; |
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
using System; | |
using System.Globalization; | |
using System.Linq; | |
using CTM.Common.PafAddress; | |
using CTM.Home.Common.Domain; | |
using CTM.Home.Common.ValueTypes; | |
using CTM.Home.Domain.Concepts; | |
using CTM.Home.Domain.Events; | |
using CTM.Home.ViewModels; | |
using TestNewProjections; |
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
static void Main(string[] args) | |
{ | |
bool run = true; | |
var sb = new StringBuilder(); | |
do | |
{ | |
var key = Console.ReadKey(); | |
if (key.Key == ConsoleKey.UpArrow) run = false; | |
else if(key.Key == ConsoleKey.Backspace) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using NUnit.Framework; | |
namespace DDD_1 | |
{ | |
class Program | |
{ |
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
ResourceSpace.Has.Resource<Home>() | |
/*(1)*/ .Map(_=>_.LastModified(r=>r.UpdateTime) | |
.Etag(r=>r.ID)) | |
/*(2)*/ .MapLastModified(_=>_.UpdateTime) | |
.MapEtag(r=>r.ID) | |
/*(3)*/ .Map().LastModified(_=>_.UpdateTime) | |
.Etag(_=>_.ID) |
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
static internal class ResponseExtensions | |
{ | |
public static string GetLinkValue(this WebResponse response, string rel) | |
{ | |
return (from header in response.Headers["Link"].Split(',') | |
let components = header.Split(';') | |
let uri = components[0] | |
where components.Any( | |
component => | |
Regex.IsMatch(component, |
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
public static IEnumerable<Dictionary<string, string>> ItemScope(this XDocument document, string schema, params string[] propertyNames) | |
{ | |
return from node in document.Document.Descendants() | |
where node.HAttr("itemtype") == schema | |
where node.HAttr("itemscope") == "itemscope" | |
select (from property in node.Descendants() | |
let propName = property.HAttr("itemprop") | |
where propertyNames.Contains(propName) | |
select property).ToDictionary(_=>_.HAttr("itemprop"), _=>_.Value); | |
} |
OlderNewer