我正在考虑将我的T4代码转换为Razor代码。我更喜欢Razor,它可以自我托管。是否有从T4到Razor语法的转换器?如果必须的话,手工完成是否微不足道?
感谢。
示例T4
<#@ template language=“C#” #>
// <autogenerated>
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
// </autogenerated>
using System;
public class <#= this.ClassName #>
{
public static void HelloPot()
{
Console.WriteLine(”Hello, POT”);
}
}
<#+
string ClassName = “MyClass”;
#>