Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AnthonySteele's full-sized avatar
💭
😪

Anthony Steele AnthonySteele

💭
😪
View GitHub Profile
@AnthonySteele
AnthonySteele / Aboutasynchandlers.md
Last active January 17, 2016 22:38
About async handlers

##Setup

Many people have the misconception that async and sync code are mutually exclusive. This is not the case. It's easier than it seems!

If you have a method on an interface for async use, then the implementation can have zero or more awaits, and the case with zero awaits covers synchronous implementations. The code below will make this clear.

We have the following example contract that models a processor of messages:

 public class Request
@AnthonySteele
AnthonySteele / AgileValues.md
Last active January 22, 2017 12:42
Agile with values
using System.Web.Mvc;
namespace FeatureTest
{
public class FeatureRazorViewEngine : RazorViewEngine
{
private const string ViewsPathTemplate = "~/Features/%1/Views/{0}.cshtml";
private const string LayoutPathTemplate = "~/Features/Layout/{0}.cshtml";
public FeatureRazorViewEngine()
@AnthonySteele
AnthonySteele / NancyModuleExtensions
Last active April 11, 2019 09:19
Example code for my blog post on function shims for NancyFx request handlers
/*
* Example code for my blog post on function shims for NancyFx request handlers
* Blog post is here: http://anthonysteele.co.uk/more-patterns-for-web-services-in-nancyfx
*/
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Nancy;