Dapper.SimpleCRUD.ModelGenerator 中使用的 T4 模板截断了 table 名称

T4 Template used in Dapper.SimpleCRUD.ModelGenerator truncated a table name

我正在使用这个 nuget 包:Dapper.SimpleCRUD.ModelGenerator which is based on this T4 template

效果很好!但是有一个小问题。这个table:

/// <summary>
/// A class which represents the CurrentStatus table.
/// </summary>
[Table("CurrentStatus")]
public partial class CurrentStatu
{
    ...
}

table CurrentStatus 生成为 CurrentStatu。我还没有查看完整的 table 列表,但可能还有其他列表?

我假设这是模板中的某种设置,用于使 table 名称成为单数或复数,但我没有找到它。

好的,我找到了解决这个问题的方法。它确实试图将 table 个名字单数化。我注释掉了模板的第 518 行并添加了第 519 行:

//tbl.ClassName=Singularize(RemoveTablePrefixes(tbl.CleanName));
tbl.ClassName=RemoveTablePrefixes(tbl.CleanName);

编辑:

我实际上最终更深入地修改了模板,以便可以选择免除某些 table 被单数化。