Skip to content

Commit 8993eaf

Browse files
committed
upgraded to dotnet 10
1 parent 2711336 commit 8993eaf

File tree

14 files changed

+195
-103
lines changed

14 files changed

+195
-103
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ jobs:
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
2020

2121
- name: Setup .NET Core
22-
uses: actions/setup-dotnet@v4
22+
uses: actions/setup-dotnet@v5
2323
with:
2424
global-json-file: global.json
2525

2626
- name: Build
2727
run: dotnet build ${{ env.PROJECT_PATH }}
2828

2929
- name: Pack
30-
run: dotnet pack ${{ env.PROJECT_PATH }} --output ${{ env.OUTPUT_DIR }}
30+
run: dotnet pack ${{ env.PROJECT_PATH }} --output ${{ env.OUTPUT_DIR }}
3131

3232
- name: Publish
3333
run: dotnet nuget push ${{ env.OUTPUT_DIR }}/*.nupkg -k ${{ env.NUGET_API_KEY }} -s ${{ env.NUGET_SOURCE }}

.gitignore

Lines changed: 129 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
4+
## Get latest from `dotnet new gitignore`
55

6-
.idea
6+
# dotenv files
7+
.env
78

89
# User-specific files
910
*.rsuser
@@ -31,7 +32,6 @@ x86/
3132
bld/
3233
[Bb]in/
3334
[Oo]bj/
34-
[Oo]ut/
3535
[Ll]og/
3636
[Ll]ogs/
3737

@@ -60,11 +60,14 @@ dlldata.c
6060
# Benchmark Results
6161
BenchmarkDotNet.Artifacts/
6262

63-
# .NET Core
63+
# .NET
6464
project.lock.json
6565
project.fragment.lock.json
6666
artifacts/
6767

68+
# Tye
69+
.tye/
70+
6871
# ASP.NET Scaffolding
6972
ScaffoldingReadMe.txt
7073

@@ -93,6 +96,7 @@ StyleCopReport.xml
9396
*.tmp_proj
9497
*_wpftmp.csproj
9598
*.log
99+
*.tlog
96100
*.vspscc
97101
*.vssscc
98102
.builds
@@ -296,6 +300,17 @@ node_modules/
296300
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
297301
*.vbw
298302

303+
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
304+
*.vbp
305+
306+
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
307+
*.dsw
308+
*.dsp
309+
310+
# Visual Studio 6 technical files
311+
*.ncb
312+
*.aps
313+
299314
# Visual Studio LightSwitch build output
300315
**/*.HTMLClient/GeneratedArtifacts
301316
**/*.DesktopClient/GeneratedArtifacts
@@ -352,6 +367,9 @@ ASALocalRun/
352367
# Local History for Visual Studio
353368
.localhistory/
354369

370+
# Visual Studio History (VSHistory) files
371+
.vshistory/
372+
355373
# BeatPulse healthcheck temp database
356374
healthchecksdb
357375

@@ -362,4 +380,110 @@ MigrationBackup/
362380
.ionide/
363381

364382
# Fody - auto-generated XML schema
365-
FodyWeavers.xsd
383+
FodyWeavers.xsd
384+
385+
# VS Code files for those working on multiple tools
386+
.vscode/*
387+
!.vscode/settings.json
388+
!.vscode/tasks.json
389+
!.vscode/launch.json
390+
!.vscode/extensions.json
391+
*.code-workspace
392+
393+
# Local History for Visual Studio Code
394+
.history/
395+
396+
# Windows Installer files from build outputs
397+
*.cab
398+
*.msi
399+
*.msix
400+
*.msm
401+
*.msp
402+
403+
# JetBrains Rider
404+
*.sln.iml
405+
.idea/
406+
407+
##
408+
## Visual studio for Mac
409+
##
410+
411+
412+
# globs
413+
Makefile.in
414+
*.userprefs
415+
*.usertasks
416+
config.make
417+
config.status
418+
aclocal.m4
419+
install-sh
420+
autom4te.cache/
421+
*.tar.gz
422+
tarballs/
423+
test-results/
424+
425+
# Mac bundle stuff
426+
*.dmg
427+
*.app
428+
429+
# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
430+
# General
431+
.DS_Store
432+
.AppleDouble
433+
.LSOverride
434+
435+
# Icon must end with two \r
436+
Icon
437+
438+
439+
# Thumbnails
440+
._*
441+
442+
# Files that might appear in the root of a volume
443+
.DocumentRevisions-V100
444+
.fseventsd
445+
.Spotlight-V100
446+
.TemporaryItems
447+
.Trashes
448+
.VolumeIcon.icns
449+
.com.apple.timemachine.donotpresent
450+
451+
# Directories potentially created on remote AFP share
452+
.AppleDB
453+
.AppleDesktop
454+
Network Trash Folder
455+
Temporary Items
456+
.apdisk
457+
458+
# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
459+
# Windows thumbnail cache files
460+
Thumbs.db
461+
ehthumbs.db
462+
ehthumbs_vista.db
463+
464+
# Dump file
465+
*.stackdump
466+
467+
# Folder config file
468+
[Dd]esktop.ini
469+
470+
# Recycle Bin used on file shares
471+
$RECYCLE.BIN/
472+
473+
# Windows Installer files
474+
*.cab
475+
*.msi
476+
*.msix
477+
*.msm
478+
*.msp
479+
480+
# Windows shortcuts
481+
*.lnk
482+
483+
# Vim temporary swap files
484+
*.swp
485+
486+
# Added by me
487+
logs
488+
LocalFileStorage
489+
*.db*

EFCore.AuditBase.sln

Lines changed: 0 additions & 46 deletions
This file was deleted.

EFCore.AuditBase.slnx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path=".editorconfig"/>
4+
<File Path=".github/workflows/main.yml"/>
5+
<File Path=".gitignore"/>
6+
<File Path="global.json"/>
7+
<File Path="Readme.md"/>
8+
</Folder>
9+
<Folder Name="/src/">
10+
<Project Path="src/EFCore.AuditBase/EFCore.AuditBase.csproj"/>
11+
</Folder>
12+
<Folder Name="/test/">
13+
<Project Path="test/EFCore.AuditBase.Demo/EFCore.AuditBase.Demo.csproj"/>
14+
<Project Path="test/EFCore.AuditBase.Tests/EFCore.AuditBase.Tests.csproj"/>
15+
</Folder>
16+
</Solution>

Readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ Install-Package Pandatech.EFCore.AuditBase
2828

2929
1. Inherit from `AuditEntityBase` in your entity classes to enable auditing.
3030
2. Use `MarkAsUpdated(userId)` and `MarkAsDeleted(userId)` methods to handle entity updates and deletions.
31-
3. Apply `OptionsBuilderExtensions.UseAuditBaseValidatorInterceptor` during the DbContext registration in your DI configuration.
31+
3. Apply `OptionsBuilderExtensions.UseAuditBaseValidatorInterceptor` during the DbContext registration in your DI
32+
configuration.
3233
4. Leverage `ModelBuilderExtensions.FilterOutDeletedMarkedObjects` to automatically exclude soft-deleted entities from
3334
EF Core queries.
3435

3536
### Registering DbContext with `UseAuditBaseValidatorInterceptor`:
3637

37-
When configuring your `DbContext`, ensure you call `UseAuditBaseValidatorInterceptor` during the service registration phase:
38+
When configuring your `DbContext`, ensure you call `UseAuditBaseValidatorInterceptor` during the service registration
39+
phase:
40+
3841
```csharp
3942
var connectionString = configuration.GetConnectionString("Postgres");
4043

@@ -84,7 +87,8 @@ public void DeleteProduct(Product product, long deletingUserId)
8487

8588
### DbContext Configuration:
8689

87-
In your `DbContext`, you can use the `FilterOutDeletedMarkedObjects` method to apply a global query filter for soft-deleted entities:
90+
In your `DbContext`, you can use the `FilterOutDeletedMarkedObjects` method to apply a global query filter for
91+
soft-deleted entities:
8892

8993
```csharp
9094
using Microsoft.EntityFrameworkCore;

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.200",
3+
"version": "10.0.101",
44
"rollForward": "latestMinor"
55
}
66
}

src/EFCore.AuditBase/AuditEntityBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ namespace EFCore.AuditBase;
55

66
public abstract class AuditEntityBase
77
{
8+
[NotMapped]
9+
internal bool IgnoreInterceptor;
10+
811
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
912

1013
public required long? CreatedByUserId { get; init; }
@@ -15,9 +18,6 @@ public abstract class AuditEntityBase
1518
[ConcurrencyCheck]
1619
public int Version { get; private set; } = 1;
1720

18-
[NotMapped]
19-
internal bool IgnoreInterceptor;
20-
2121
public void MarkAsUpdated(long? userId, DateTime? updatedAt = null)
2222
{
2323
UpdatedAt = updatedAt ?? DateTime.UtcNow;
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<PackageIcon>pandatech.png</PackageIcon>
88
<PackageReadmeFile>Readme.md</PackageReadmeFile>
99
<Authors>Pandatech</Authors>
1010
<Copyright>MIT</Copyright>
11-
<Version>3.0.10</Version>
11+
<Version>4.0.0</Version>
1212
<PackageId>Pandatech.EFCore.AuditBase</PackageId>
1313
<Title>Pandatech EFCore AuditBase</Title>
1414
<PackageTags>Pandatech, library, audit, optimistic lock, tracking, efcore, soft delete, versioning</PackageTags>
1515
<Description>Pandatech.EFCore.AuditBase provides a robust auditing solution for EF Core applications, ensuring traceability and integrity of entity modifications. It seamlessly integrates auditing capabilities into your EF Core entities, enforcing best practices for entity state changes, deletion handling, and versioning to support concurrency control. Ideal for applications requiring a reliable audit trail and compliance with data handling standards.</Description>
1616
<RepositoryUrl>https://github.com/PandaTechAM/be-lib-efcore-audit-base</RepositoryUrl>
17-
<PackageReleaseNotes>Nuget updates</PackageReleaseNotes>
17+
<PackageReleaseNotes>Dotnet 10 update</PackageReleaseNotes>
18+
19+
<!-- Never run analyzers as part of compilation (local, CI, dotnet build/test/publish) -->
20+
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
21+
22+
<!-- Keep background/live analysis in the IDE -->
23+
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
24+
25+
<!-- Optional: ensure code-style analyzers don't run during build either -->
26+
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
1827
</PropertyGroup>
1928

2029
<ItemGroup>
@@ -23,8 +32,13 @@
2332
</ItemGroup>
2433

2534
<ItemGroup>
26-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.8" />
27-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
35+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
36+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
37+
<PackageReference Include="Pandatech.Analyzers" Version="1.6.0"/>
38+
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.17.0.131074">
39+
<PrivateAssets>all</PrivateAssets>
40+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
41+
</PackageReference>
2842
</ItemGroup>
2943

3044
</Project>

src/EFCore.AuditBase/Extensions/DbOptionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Microsoft.EntityFrameworkCore;
2-
using EFCore.AuditBase.Interceptors;
1+
using EFCore.AuditBase.Interceptors;
2+
using Microsoft.EntityFrameworkCore;
33

44
namespace EFCore.AuditBase.Extensions;
55

0 commit comments

Comments
 (0)