Skip to content

Instantly share code, notes, and snippets.

@jmarnold
Created June 1, 2012 16:57
Show Gist options
  • Save jmarnold/2853594 to your computer and use it in GitHub Desktop.
Save jmarnold/2853594 to your computer and use it in GitHub Desktop.
Templating junk
public static class TemplateExtensions
{
public static string ToMustacheKey(this string name)
{
return "{{" + name + "}}";
}
public static string ToMustacheKey<T>(this Expression<Func<T, object>> expression)
{
return expression.ToAccessor().Name.ToMustacheKey();
}
public static string TemplateField<T>(this IFubuPage<T> page, Expression<Func<T, object>> expression) where T : class
{
return expression.ToMustacheKey();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment