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

Commit bc2e87f

Browse files
committed
Call BeforeExecFilter on ExecuteSqlAsync
1 parent fd9aa42 commit bc2e87f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ServiceStack.OrmLite/Async/OrmLiteWriteCommandExtensionsAsync.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ internal static Task<int> ExecuteSqlAsync(this IDbCommand dbCmd, string sql, Can
2727
{
2828
dbCmd.CommandText = sql;
2929

30-
if (OrmLiteConfig.ResultsFilter != null)
31-
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd).InTask();
32-
3330
if (Log.IsDebugEnabled)
3431
Log.DebugCommand(dbCmd);
3532

33+
OrmLiteConfig.BeforeExecFilter?.Invoke(dbCmd);
34+
35+
if (OrmLiteConfig.ResultsFilter != null)
36+
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd).InTask();
37+
3638
return dbCmd.GetDialectProvider().ExecuteNonQueryAsync(dbCmd, token);
3739
}
3840

@@ -46,6 +48,8 @@ internal static Task<int> ExecuteSqlAsync(this IDbCommand dbCmd, string sql, obj
4648
if (Log.IsDebugEnabled)
4749
Log.DebugCommand(dbCmd);
4850

51+
OrmLiteConfig.BeforeExecFilter?.Invoke(dbCmd);
52+
4953
if (OrmLiteConfig.ResultsFilter != null)
5054
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd).InTask();
5155

0 commit comments

Comments
 (0)