Skip to content

Commit

Permalink
Adding SaveChangesGetAudit() methods to the AuditIdentityDbContext (
Browse files Browse the repository at this point in the history
  • Loading branch information
thepirat000 committed Oct 24, 2024
1 parent 5bdf8a1 commit 236aa68
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to Audit.NET and its extensions will be documented in this f

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [27.1.0] - 2024-10-24:
- Audit.EntityFramework.Identity and Audit.EntityFramework.Identity.Core: Adding `SaveChangesGetAudit()` methods to the `AuditIdentityDbContext` (#707)
- Audit.NET: Upgrading System.Text.Json 6.0.9 to the latest 6.0.10 ([CVE-2024-43485](https://www.cve.org/CVERecord?id=CVE-2024-43485))

## [27.0.3] - 2024-09-25:
- Audit.EntityFramework.Core: Fixing issue with Complex Type properties when using the EF DataProvider Property Matching (#697)

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>27.0.3</Version>
<Version>27.1.0</Version>
<PackageReleaseNotes></PackageReleaseNotes>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.17" />
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
Expand Down
21 changes: 21 additions & 0 deletions src/Audit.EntityFramework.Identity/AuditIdentityDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,27 @@ public override int SaveChanges()
return _helper.SaveChanges(this, () => base.SaveChanges());
}

/// <summary>
/// Executes the SaveChanges operation in the DbContext and returns the EF audit event generated
/// </summary>
/// <returns>The generated EF audit event</returns>
[MethodImpl(MethodImplOptions.NoInlining)]
public EntityFrameworkEvent SaveChangesGetAudit()
{
return _helper.SaveChangesGetAudit(this, () => base.SaveChanges());
}

/// <summary>
/// Executes the SaveChanges operation in the DbContext and returns the EF audit event generated
/// </summary>
/// <param name="cancellationToken">The cancellation token</param>
/// <returns>The generated EF audit event</returns>
[MethodImpl(MethodImplOptions.NoInlining)]
public async Task<EntityFrameworkEvent> SaveChangesGetAuditAsync(CancellationToken cancellationToken = default)
{
return await _helper.SaveChangesGetAuditAsync(this, () => base.SaveChangesAsync(cancellationToken), cancellationToken);
}

/// <summary>
/// Saves the changes asynchronously.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.EntityFramework/Audit.EntityFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.FileSystem/Audit.FileSystem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.MongoClient/Audit.MongoClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.Mvc.Core/Audit.Mvc.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.Mvc/Audit.Mvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.3.0" />
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
<Reference Include="System.Web" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.NET/Audit.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.WebApi.Core/Audit.WebApi.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.WebApi/Audit.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.3.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version="5.3.0" />
<Reference Include="System.Web" />
Expand Down
2 changes: 1 addition & 1 deletion test/Audit.UnitTest/Audit.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="System.Text.Json" Version="6.0.9" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net462' and '$(TargetFramework)' != 'net472' ">
Expand Down

0 comments on commit 236aa68

Please sign in to comment.