I am using this nuget package: Dapper.SimpleCRUD.ModelGenerator which is based on this T4 template.
It works great! But there is one small problem. This table:
/// <summary>
/// A class which represents the CurrentStatus table.
/// </summary>
[Table("CurrentStatus")]
public partial class CurrentStatu
{
...
}
The table CurrentStatus
was generated as CurrentStatu
. I've not yet looked over the entire list of tables, but there may be others?
I would assume this is some sort of setting in the template to make table names singular or plural, but I'm not finding it.
Ok, I found a way to fix this. It was indeed trying to singularize table names. I commented out line 518 of the template and added line 519:
//tbl.ClassName=Singularize(RemoveTablePrefixes(tbl.CleanName));
tbl.ClassName=RemoveTablePrefixes(tbl.CleanName);
EDIT:
I actually ended up more deeply modifying the template to have the option to exempt certain tables from being singularized.