Skip to content

Instantly share code, notes, and snippets.

View jcolebrand's full-sized avatar

J. Cole Brand jcolebrand

View GitHub Profile
@jcolebrand
jcolebrand / httpcontextwrapper.cs
Created February 24, 2017 15:31
for talking to Nick Craver
// this is mockable in your unit tests so you can just assign the func over it
public static Func<HttpContextBase> Context = () => new HttpContextWrapper(HttpContext.Current);
public void SomeMethod(){
var context = Context();
if (context == null) return;
// use context here like you would HttpContext.Current
}
>>>>>> OS Version
SystemDirectory : C:\Windows\system32
Organization :
BuildNumber : 14393
RegisteredUser : Windows User
SerialNumber : 00376-30818-63755-AA823
Version : 10.0.14393
namespace Tooling.WebApi.Common.Utility
{
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;