PostGres SQL - Error on insert
Simulation: 1 - Remove pluralization: SqlMapperExtensions.TableNameMapper = (type) => { return """+ type.Name + """; };
2 - Create a simple model public class UserData { public int Id{get;set;} public string Name{get;set;} }
3 - Try insert connection.Insert(new UseData{Name='Mosheh'});
@NickCraver
The solution is:
In SqlMapperExtention line 968:
sb.Append($"{tableName}.\"{property.Name}\"");
While this change may fix you, it would break others (whose case depends on the unquoted case insensitivity). Please see DapperLib/Dapper#722 where we aim to give more control over that in the next major version. For now, you can quote your column names in attributes if you want case-sensitive behavior in Postgres :)