diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 0829265044..3f22385ea6 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -108,7 +108,6 @@ public class EfCoreRepository : RepositoryBase, IE public async override Task InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { - CheckChangeTracking(); CheckAndSetId(entity); var dbContext = await GetDbContextAsync(); @@ -125,7 +124,6 @@ public class EfCoreRepository : RepositoryBase, IE public async override Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default) { - CheckChangeTracking(); var entityArray = entities.ToArray(); if (entityArray.IsNullOrEmpty()) { @@ -161,7 +159,6 @@ public class EfCoreRepository : RepositoryBase, IE public async override Task UpdateAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { - CheckChangeTracking(); var dbContext = await GetDbContextAsync(); dbContext.Attach(entity); @@ -184,8 +181,6 @@ public class EfCoreRepository : RepositoryBase, IE return; } - CheckChangeTracking(); - cancellationToken = GetCancellationToken(cancellationToken); if (BulkOperationProvider != null) @@ -212,7 +207,6 @@ public class EfCoreRepository : RepositoryBase, IE public async override Task DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default) { - CheckChangeTracking(); var dbContext = await GetDbContextAsync(); dbContext.Set().Remove(entity); @@ -231,8 +225,6 @@ public class EfCoreRepository : RepositoryBase, IE return; } - CheckChangeTracking(); - cancellationToken = GetCancellationToken(cancellationToken); if (BulkOperationProvider != null) @@ -325,7 +317,6 @@ public class EfCoreRepository : RepositoryBase, IE public async override Task DeleteAsync(Expression> predicate, bool autoSave = false, CancellationToken cancellationToken = default) { - CheckChangeTracking(); var dbContext = await GetDbContextAsync(); var dbSet = dbContext.Set(); @@ -446,15 +437,6 @@ public class EfCoreRepository : RepositoryBase, IE true ); } - - - protected virtual void CheckChangeTracking() - { - if (!ShouldTrackingEntityChange()) - { - Logger.LogWarning("This repository has disabled change tracking. Your changes may not be saved!"); - } - } } public class EfCoreRepository : EfCoreRepository,