public async static Task HardDeleteAsync<TEntity>( this IBasicRepository<TEntity> repository, IEnumerable<TEntity> entities, bool autoSave = false, CancellationToken cancellationToken = default ) where TEntity : class, IEntity, ISoftDelete { var uowManager = repository.GetUnitOfWorkManager(); if (uowManager.Current == null) { using (var uow = uowManager.Begin()) { await HardDeleteWithUnitOfWorkAsync(repository, entities, autoSave, cancellationToken, uowManager.Current); await uow.CompleteAsync(cancellationToken); } } else { await HardDeleteWithUnitOfWorkAsync(repository, entities, autoSave, cancellationToken, uowManager.Current); } }