在我的 ASP MVC 项目中,每当我向项目中添加新表时,都会创建两个模型。一个在文本模板转换工具包(带.tt扩展名的文件)下,另一个在通用Models文件夹中(这个似乎希望在文件末尾默认使用“1”)。

每当对数据库进行更改时,似乎.tt文件下的所有模型都会根据该表上数据库中当前存在的字段进行刷新。此之外的文件是通用Models文件夹,但保持原样。因此,我们将所有模型验证方法都放在了这些.cs文件中(文件名末尾带有“1”)。
但是,在一种情况下,我需要从文件下的模型中删除一个字段.tt,以便在另一个文件中执行验证.cs。这是我执行的验证:
    private string agentId;
    //here, AgentId overrrides the field in the BankListAgentId.cs file, 
    //which MUST be commented out.
    [DisplayName("Agent ID")]
    public string AgentId
    {
        get { return agentId; }
        set { agentId = this.scrubAgentId(value); }
    }
有没有办法在此.cs文件中指定AgentId此处的字段(名称末尾带有“1”的文件)覆盖AgentId field in the.cs file found under the.tt` 文件?