Created
June 1, 2012 16:57
-
-
Save jmarnold/2853594 to your computer and use it in GitHub Desktop.
Templating junk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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