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

Commit 8015740

Browse files
committed
Add GetQuotedColumnName extension methods to resolve a column from Model/Field Defs
1 parent 6684dfa commit 8015740

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/ServiceStack.OrmLite/OrmLiteDialectProviderExtensions.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,19 @@ public static string FmtColumn(this string columnName)
2626
{
2727
return OrmLiteConfig.DialectProvider.NamingStrategy.GetColumnName(columnName);
2828
}
29+
30+
public static string GetQuotedColumnName(this IOrmLiteDialectProvider dialect,
31+
FieldDefinition fieldDef)
32+
{
33+
return dialect.GetQuotedColumnName(fieldDef.FieldName);
34+
}
35+
36+
public static string GetQuotedColumnName(this IOrmLiteDialectProvider dialect,
37+
ModelDefinition modelDef, FieldDefinition fieldDef)
38+
{
39+
return dialect.GetQuotedTableName(modelDef.ModelName) +
40+
"." +
41+
dialect.GetQuotedColumnName(fieldDef.FieldName);
42+
}
2943
}
3044
}

0 commit comments

Comments
 (0)