Skip to content
Permalink
Browse files

Also log InsertAsync APIs

  • Loading branch information...
mythz committed May 3, 2019
1 parent 98b8342 commit e30efedb5468ebfc258e27b9e7108dcd07767834
@@ -8,11 +8,14 @@
using System.Data;
using System.Threading;
using System.Threading.Tasks;
using ServiceStack.Logging;

namespace ServiceStack.OrmLite
{
public static class OrmLiteResultsFilterExtensionsAsync
{
internal static ILog Log = LogManager.GetLogger(typeof(OrmLiteResultsFilterExtensionsAsync));

public static Task<int> ExecNonQueryAsync(this IDbCommand dbCmd, string sql, object anonType, CancellationToken token = default(CancellationToken))
{
if (anonType != null)
@@ -23,6 +26,9 @@ public static Task<int> ExecNonQueryAsync(this IDbCommand dbCmd, string sql, obj
if (OrmLiteConfig.ResultsFilter != null)
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd).InTask();

if (Log.IsDebugEnabled)
Log.DebugCommand(dbCmd);

return dbCmd.GetDialectProvider().ExecuteNonQueryAsync(dbCmd, token);
}

@@ -33,9 +39,14 @@ public static Task<int> ExecNonQueryAsync(this IDbCommand dbCmd, string sql, Dic

dbCmd.CommandText = sql;

OrmLiteConfig.BeforeExecFilter?.Invoke(dbCmd);

if (OrmLiteConfig.ResultsFilter != null)
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd).InTask();

if (Log.IsDebugEnabled)
Log.DebugCommand(dbCmd);

return dbCmd.GetDialectProvider().ExecuteNonQueryAsync(dbCmd, token);
}

@@ -44,6 +55,9 @@ public static Task<int> ExecNonQueryAsync(this IDbCommand dbCmd, CancellationTok
if (OrmLiteConfig.ResultsFilter != null)
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd).InTask();

if (Log.IsDebugEnabled)
Log.DebugCommand(dbCmd);

return dbCmd.GetDialectProvider().ExecuteNonQueryAsync(dbCmd, token);
}

@@ -53,14 +53,14 @@ public static int ExecNonQuery(this IDbCommand dbCmd, string sql, Dictionary<str

public static int ExecNonQuery(this IDbCommand dbCmd)
{
if (Log.IsDebugEnabled)
Log.DebugCommand(dbCmd);

OrmLiteConfig.BeforeExecFilter?.Invoke(dbCmd);

if (OrmLiteConfig.ResultsFilter != null)
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd);

if (Log.IsDebugEnabled)
Log.DebugCommand(dbCmd);

return dbCmd.ExecuteNonQuery();
}

@@ -70,14 +70,14 @@ public static int ExecNonQuery(this IDbCommand dbCmd, string sql, Action<IDbComm

dbCmd.CommandText = sql;

if (Log.IsDebugEnabled)
Log.DebugCommand(dbCmd);

OrmLiteConfig.BeforeExecFilter?.Invoke(dbCmd);

if (OrmLiteConfig.ResultsFilter != null)
return OrmLiteConfig.ResultsFilter.ExecuteSql(dbCmd);

if (Log.IsDebugEnabled)
Log.DebugCommand(dbCmd);

return dbCmd.ExecuteNonQuery();
}

0 comments on commit e30efed

Please sign in to comment.
You can’t perform that action at this time.