Skip to content

Commit 485db2c

Browse files
committed
Refactor interfaces, update Azure Key Vault options, and improve code readability
1 parent 3b45172 commit 485db2c

File tree

58 files changed

+231
-495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+231
-495
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These are supported funding model platforms
22
open_collective: genocs
3-
custom: ['https://www.buymeacoffee.com/genocs']
3+
custom: ["https://www.buymeacoffee.com/genocs"]

.github/workflows/build_and_test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Build test and pack
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [main, develop]
88

99
jobs:
1010
build:
@@ -14,20 +14,20 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4
17-
17+
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v4
2020
with:
2121
dotnet-version: 8.0.x
22-
22+
2323
- name: Restore dependencies
2424
run: dotnet restore
25-
25+
2626
- name: Build
2727
run: dotnet build -c Debug --no-restore
28-
28+
2929
- name: Test
3030
run: dotnet test -c Debug --no-build --verbosity normal
31-
31+
3232
- name: Pack
3333
run: dotnet pack -c Debug --no-build --verbosity normal

.github/workflows/dockerhub-publish.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ on:
1313
description: "Image Version"
1414

1515
# Default value if no value is explicitly provided
16-
default: "6.0.0"
16+
default: "6.1.0"
1717

1818
# Input has to be provided for the workflow to run
1919
required: true
2020

21-
2221
jobs:
2322
build:
2423
name: Publish Docker Image
@@ -27,21 +26,21 @@ jobs:
2726
steps:
2827
- name: Checkout
2928
uses: actions/checkout@v4
30-
29+
3130
- name: Setup .NET
3231
uses: actions/setup-dotnet@v4
3332
with:
3433
dotnet-version: 8.0.x
35-
34+
3635
- name: Restore dependencies
3736
run: dotnet restore
38-
37+
3938
- name: Build
4039
run: dotnet build -c Debug --no-restore
41-
40+
4241
- name: Test
4342
run: dotnet test --no-build --verbosity normal
44-
43+
4544
- name: Pack
4645
run: dotnet pack --no-build --verbosity normal
4746

.github/workflows/nuget-publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ on:
1313
description: "Packages Version"
1414

1515
# Default value if no value is explicitly provided
16-
default: "6.0.0"
16+
default: "6.1.0"
1717

1818
# Input has to be provided for the workflow to run
1919
required: true
2020

21-
2221
jobs:
2322
build:
2423
name: Update NuGet packages

Directory.Build.props

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)dotnet.ruleset</CodeAnalysisRuleSet>
1010
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1111
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
12-
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
12+
<LangVersion>10.0</LangVersion>
13+
<Company>Genocs</Company>
14+
<Copyright>Genocs 2024</Copyright>
15+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
16+
<PackageProjectUrl>https://github.com/Genocs/genocs-library</PackageProjectUrl>
17+
<RepositoryUrl>https://github.com/Genocs/genocs-library.git</RepositoryUrl>
18+
<PackageIcon>icon.png</PackageIcon>
19+
<RepositoryType>git</RepositoryType>
20+
<EnableNETAnalyzers>True</EnableNETAnalyzers>
1321
</PropertyGroup>
1422

1523
<ItemGroup>

src/Genocs.Auth/Genocs.Auth.csproj

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@
77
<AssemblyName>Genocs.Auth</AssemblyName>
88
<Title>The authorization library useful to build .NET Core projects.</Title>
99
<Description>The authorization library useful to build .NET Core projects.</Description>
10-
<LangVersion>10.0</LangVersion>
1110
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
12-
<Version>6.0.0</Version>
11+
<Version>6.1.0</Version>
1312
<MinClientVersion>5.0.0</MinClientVersion>
1413
<Authors>Nocco Giovanni Emanuele</Authors>
15-
<Company>Genocs</Company>
16-
<Copyright>Genocs 2024</Copyright>
17-
<PackageLicenseFile>LICENSE</PackageLicenseFile>
18-
<PackageProjectUrl>https://github.com/Genocs/genocs-library</PackageProjectUrl>
19-
<RepositoryUrl>https://github.com/Genocs/genocs-library.git</RepositoryUrl>
20-
<PackageIcon>icon.png</PackageIcon>
21-
<RepositoryType>git</RepositoryType>
2214
<PackageTags>aggregate architecture boilerplate ddd ddd-architecture design-patterns domain-driven-design dotnet dotnetcore dotnet-core microservice microservices solid solid-principles</PackageTags>
2315
<PackageReadmeFile>README_NUGET.md</PackageReadmeFile>
2416
<PackageReleaseNotes>Aligned to the ecosystem</PackageReleaseNotes>
@@ -53,8 +45,8 @@
5345
</ItemGroup>
5446

5547
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
56-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
57-
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.8" />
48+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.*" />
49+
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.*" />
5850
</ItemGroup>
5951

6052
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">

src/Genocs.Common/Configurations/AppOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class AppOptions
1515
/// </summary>
1616
public bool Enabled { get; set; }
1717

18-
1918
/// <summary>
2019
/// Application name.
2120
/// </summary>

src/Genocs.Common/Genocs.Common.csproj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@
77
<AssemblyName>Genocs.Common</AssemblyName>
88
<Title>The Genocs Library - Common components.</Title>
99
<Description>The common components to build .NET Core projects along with Genocs Library.</Description>
10-
<LangVersion>10.0</LangVersion>
1110
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
12-
<Version>6.0.0</Version>
11+
<Version>6.1.0</Version>
1312
<MinClientVersion>5.0.0</MinClientVersion>
1413
<Authors>Nocco Giovanni Emanuele</Authors>
15-
<Company>Genocs</Company>
16-
<Copyright>Genocs 2024</Copyright>
17-
<PackageLicenseFile>LICENSE</PackageLicenseFile>
18-
<PackageProjectUrl>https://github.com/Genocs/genocs-library</PackageProjectUrl>
19-
<RepositoryUrl>https://github.com/Genocs/genocs-library.git</RepositoryUrl>
20-
<PackageIcon>icon.png</PackageIcon>
21-
<RepositoryType>git</RepositoryType>
2214
<PackageTags>aggregate architecture boilerplate ddd ddd-architecture design-patterns domain-driven-design dotnet dotnetcore dotnet-core microservice microservices solid solid-principles</PackageTags>
2315
<PackageReadmeFile>README_NUGET.md</PackageReadmeFile>
2416
<PackageReleaseNotes>Aligned to the ecosystem</PackageReleaseNotes>

src/Genocs.Common/README_NUGET.md

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,5 @@ Please check the GitHub repository getting more info.
1515

1616
## Release notes
1717

18-
### [2024-01-23] 5.0.6
19-
- Refactory Settings
20-
- Updated nuget packages
18+
Release notes can be found in the [CHANGELOG](https://github.com/Genocs/genocs-library/blob/b98629b4001aad7a2123190cfd4cc63ae7b6f292/CHANGELOG.md) file.
2119

22-
### [2023-11-25] 5.0.5
23-
- Moved to NET8
24-
25-
### [yyyy-mm-dd] 5.0.4
26-
-
27-
28-
### [yyyy-mm-dd] 5.0.3
29-
-
30-
31-
### [yyyy-mm-dd] 5.0.2
32-
-
33-
34-
### [yyyy-mm-dd] 5.0.1
35-
-
36-
37-
### [2023-11-25] 5.0.0
38-
- Moved to NET8
39-
40-
### [2023-10-13] 5.0.0-preview.5.0
41-
- Added [editorconfig](https://editorconfig.org/)
42-
- Added StyleCop
43-
- Updated logo
44-
- Updated readme
45-
46-
### [2023-03-12] 5.0.0-preview.4.0
47-
- Implemented MongoDB repository interfaces
48-
49-
### [2023-03-24] 5.0.0
50-
- New Architecture
51-
52-
### [2023-03-12] 3.1.0
53-
- Added Builders
54-
55-
### [2023-03-12] 3.0.0
56-
- Refactory to implement CQRS pattern
57-
58-
### [2023-03-04] 2.4.1
59-
- Updated System.Text.Json

src/Genocs.Common/Types/Extensions.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static class Extensions
2121
return string.Empty;
2222
}
2323

24-
var defaultValueCache = new Dictionary<Type, object>();
24+
var defaultValueCache = new Dictionary<Type, object?>();
2525

2626
if (TryGetDefaultValue(type, out object? instance, defaultValueCache))
2727
{
@@ -32,11 +32,11 @@ public static class Extensions
3232
}
3333

3434
public static object SetDefaultInstanceProperties(this object instance)
35-
=> SetDefaultInstanceProperties(instance, new Dictionary<Type, object>());
35+
=> SetDefaultInstanceProperties(instance, new Dictionary<Type, object?>());
3636

37-
private static object SetDefaultInstanceProperties(object instance, Dictionary<Type, object> defaultValueCache)
37+
private static object SetDefaultInstanceProperties(object instance, Dictionary<Type, object?> defaultValueCache)
3838
{
39-
defaultValueCache ??= new Dictionary<Type, object>();
39+
defaultValueCache ??= new Dictionary<Type, object?>();
4040

4141
var type = instance.GetType();
4242

@@ -51,7 +51,7 @@ private static object SetDefaultInstanceProperties(object instance, Dictionary<T
5151
return instance;
5252
}
5353

54-
private static bool TryGetDefaultValue(Type type, out object? defaultValue, Dictionary<Type, object> defaultValueCache)
54+
private static bool TryGetDefaultValue(Type type, out object? defaultValue, Dictionary<Type, object?> defaultValueCache)
5555
{
5656
if (defaultValueCache.TryGetValue(type, out defaultValue))
5757
{
@@ -116,6 +116,7 @@ private static bool TryGetDefaultValue(Type type, out object? defaultValue, Dict
116116
return false;
117117
}
118118

119+
// TODO: Refactor this to remove the use of FormatterServices
119120
defaultValue = FormatterServices.GetUninitializedObject(type);
120121

121122
defaultValueCache[type] = defaultValue;

0 commit comments

Comments
 (0)