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

Commit bcf9c1b

Browse files
committed
Allow Param Name to be customized
1 parent 4ce46af commit bcf9c1b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ServiceStack.OrmLite/OrmLiteConfig.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,7 @@ public static IOrmLiteExecFilter ExecFilter
193193
public static bool IsCaseInsensitive { get; set; }
194194

195195
public static bool DeoptimizeReader { get; set; }
196+
197+
public static Func<string, string> ParamNameFilter { get; set; }
196198
}
197199
}

src/ServiceStack.OrmLite/OrmLiteDialectProviderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class OrmLiteDialectProviderExtensions
88
{
99
public static string GetParam(this IOrmLiteDialectProvider dialect, string name)
1010
{
11-
return dialect.ParamString + name;
11+
return dialect.ParamString + (OrmLiteConfig.ParamNameFilter?.Invoke(name) ?? name);
1212
}
1313

1414
public static string GetParam(this IOrmLiteDialectProvider dialect, int indexNo = 0)

tests/ServiceStack.OrmLite.Tests/Issues/MultipleSelfJoinsWithAliases.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ public void Can_use_CustomSql()
197197
Assert.That(salesView.SellerFirstName, Is.EqualTo("SellerFirst"));
198198
Assert.That(salesView.SellerLastName, Is.EqualTo("LastSeller"));
199199
Assert.That(salesView.SellerInitials, Is.EqualTo("SL"));
200-
201-
sales.PrintDump();
202200
}
203201
}
204202

0 commit comments

Comments
 (0)