Skip to content

Commit f0222ac

Browse files
committed
Skip action invocation by default. Clarify documentation.
1 parent 26b1453 commit f0222ac

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/shared/Z.EF.Plus.QueryFuture.Shared/QueryFutureManager.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,18 @@ static QueryFutureManager()
5656
public static bool AllowQueryBatch { get; set; } = true;
5757

5858
/// <summary>Gets or sets a delegate to be invoked directly before executing the batch DbCommand.</summary>
59-
public static Action<DbCommand> OnBatchExecuting { get; set; } = cmd => { };
59+
/// <remarks>
60+
/// This delegate is only invoked when queries are actually executed as a batch containing multiple queries.
61+
/// i.e. When AllowQueryBatch=false or only a single query is pending, this delegate is not invoked.
62+
/// </remarks>
63+
public static Action<DbCommand> OnBatchExecuting { get; set; } = null;
6064

6165
/// <summary>Gets or sets a delegate to be invoked directly after executing the batch DbCommand.</summary>
62-
public static Action<DbCommand> OnBatchExecuted { get; set; } = cmd => { };
66+
/// <remarks>
67+
/// This delegate is only invoked when queries are actually executed as a batch containing multiple queries.
68+
/// i.e. When AllowQueryBatch=false or only a single query is pending, this delegate is not invoked.
69+
/// </remarks>
70+
public static Action<DbCommand> OnBatchExecuted { get; set; } = null;
6371

6472
/// <summary>Gets or sets the weak table used to cache future batch associated to a context.</summary>
6573
/// <value>The weak table used to cache future batch associated to a context.</value>

0 commit comments

Comments
 (0)