Skip to content

Instantly share code, notes, and snippets.

View bennor's full-sized avatar

Bennor McCarthy bennor

View GitHub Profile
@bennor
bennor / ProxyRestService.cs
Last active October 24, 2023 15:31
A polyfill for Refit 2.0+ in scripting environments (e.g. LINQPad). Warning: This won't work on all platforms Refit 2.0+ supports (e.g. iOS, maybe WinRT?).
using System.Net.Http;
using Castle.DynamicProxy; // From Castle.Core
using Refit;
public class ProxyRestService
{
static readonly ProxyGenerator Generator = new ProxyGenerator();
public static T For<T>(HttpClient client)
where T : class