Skip to content

Instantly share code, notes, and snippets.

@jbogard
jbogard / UrlHelprLinkr.cs
Created December 11, 2013 21:37
Hyprlinkr + UrlHelper
using System;
using System.Linq.Expressions;
using System.Web.Http;
using System.Web.Http.Routing;
using Ploeh.Hyprlinkr;
public static class UrlHelperExtensions
{
public static Uri Link<T, TResult>(this UrlHelper helper, Expression<Func<T, TResult>> expression)
where T : ApiController
public abstract class Entity
{
public int Id {get;set;}
}
public class EntityFrameworkSession : ISession
{
private readonly DbContext context;
public EntityFrameworkSession(DbContext context)