Hello,
I was wondering if it's possible to add your own extension or helper utility classes to use in template generation like the GeneratorUtils.CamelCaseString()
.
To illustrate my use case, I have a lpt template where I would like to use kebab-case for urls.
Either through an extension class like this:
public static class StringExtensions
{
public static string ToKebabCase(this string text)
{
return Regex.Replace(text, "(?<!^)(?<!/)([A-Z][a-z]|(?<=[a-z])[A-Z0-9])", "-$1", RegexOptions.Compiled).Trim().ToLower();
}
}
So that in my template I can do:
<% foreach(var entityToProcess in entitiesToProcess){ %>
public const string <%=entityToProcess.Name%> = "<%=entityToProcess.Name.ToKebabCase()%>";
<%}%>
or through a general utility class like the GeneratorUtils.CamelCaseString()
Is this something that's possible to do?