From e75923c3ac0a24faa7928b258098f71f3a569b92 Mon Sep 17 00:00:00 2001 From: Dat Nguyen Date: Wed, 29 Mar 2017 11:21:38 +0700 Subject: [PATCH] Support interception for BatchExtensions functions Signed-off-by: Dat Nguyen --- Source/EntityFramework.Extended/Batch/SqlServerBatchRunner.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/EntityFramework.Extended/Batch/SqlServerBatchRunner.cs b/Source/EntityFramework.Extended/Batch/SqlServerBatchRunner.cs index 8f2fbb0..78b671e 100644 --- a/Source/EntityFramework.Extended/Batch/SqlServerBatchRunner.cs +++ b/Source/EntityFramework.Extended/Batch/SqlServerBatchRunner.cs @@ -12,6 +12,7 @@ using EntityFramework.Extensions; using EntityFramework.Mapping; using EntityFramework.Reflection; +using System.Data.Entity.Infrastructure.Interception; namespace EntityFramework.Batch { @@ -121,6 +122,7 @@ private int InternalDelete(ObjectContext objectContext, EntityMap entit deleteCommand.CommandText = sqlBuilder.ToString(); + DbInterception.Dispatch.Command.NonQuery(deleteCommand, new DbCommandInterceptionContext(objectContext.InterceptionContext)); #if NET45 int result = async ? await deleteCommand.ExecuteNonQueryAsync().ConfigureAwait(false) @@ -364,6 +366,7 @@ private int InternalUpdate(ObjectContext objectContext, EntityMap entit sqlBuilder.Append(")"); updateCommand.CommandText = sqlBuilder.ToString(); + DbInterception.Dispatch.Command.NonQuery(updateCommand, new DbCommandInterceptionContext(objectContext.InterceptionContext)); #if NET45 int result = async