Skip to content

Commit

Permalink
Add new function ChangeTracker clear
Browse files Browse the repository at this point in the history
  • Loading branch information
coderstrong committed Apr 27, 2024
1 parent faefc09 commit 2c4bdbd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net8.0</TargetFramework>
<SonarQubeExclude>True</SonarQubeExclude>
<SonarQubeTestProject>False</SonarQubeTestProject>
<Version>1.1.16</Version>
<Version>1.1.17</Version>
<ApplicationIcon>logo.ico</ApplicationIcon>
<Authors>JohnnyTran</Authors>
<Company>MakeSimple</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ public async Task<bool> SaveAsync(CancellationToken cancellationToken = default)
{
return await _context.SaveAsync(cancellationToken).ConfigureAwait(false);
}

public void ChangeTrackerClear()
{
_context.ChangeTracker.Clear();
}
}
}
6 changes: 6 additions & 0 deletions src/MakeSimple.SharedKernel/Contract/IUnitOfWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,11 @@ public interface IUnitOfWork<TContext> : IDatabaseContext
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<bool> AnyAsync<TEntity>(Expression<Func<TEntity, bool>> filter, CancellationToken cancellationToken = default) where TEntity : Entity;

/// <summary>
/// Clean all instance tracker object
/// </summary>
/// <returns></returns>
void ChangeTrackerClear();
}
}

0 comments on commit 2c4bdbd

Please sign in to comment.