是否可以在t4模板中定义新类?

atr*_*eon 7 t4

是否可以在t4模板中定义新类?

我尝试了这个,但它给了我一个错误'包含类功能的模板必须以类功能结束'

<#+
    public class AppSettingDefinition
    {
        private string _dataType;
        public string DataType
        {
            get { return _dataType; }
            set { _dataType = value; }
        }
    }
#>
Run Code Online (Sandbox Code Playgroud)

atr*_*eon 7

是的,这是可能的,我收到的错误是因为我有课后功能关闭标签#>