Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 72144b5

Browse files
committed
Support pgsql naming strategy when trying to infer column from mangled names
1 parent 091ce97 commit 72144b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ServiceStack.OrmLite/OrmLiteWriteExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ private static int TryGuessColumnIndex(string fieldName, IDataReader dataReader)
360360
{
361361
return i;
362362
}
363+
364+
// Cater for Naming Strategies like PostgreSQL that has lower_underscore names
365+
if (dbFieldNameSanitized.Replace("_", "").EndsWith(fieldName.Replace("_",""), StringComparison.OrdinalIgnoreCase))
366+
{
367+
return i;
368+
}
363369
}
364370

365371
return NotFound;

0 commit comments

Comments
 (0)