Skip to content

Commit 98ea614

Browse files
authored
chore: remove FluentAssertions (#326)
* chore: remove FluentAssertions * chore: drop net8 support * feat: add datetime calculator methods * chore: remove script
1 parent 836eb9d commit 98ea614

File tree

47 files changed

+340
-280
lines changed

Some content is hidden

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

47 files changed

+340
-280
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
test-net8:
11-
runs-on: ubuntu-latest
12-
container: mcr.microsoft.com/dotnet/sdk:8.0
13-
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v3
17-
- name: Build
18-
run: ./build.sh net8.0
19-
- name: Test
20-
run: ./test.sh net8.0
21-
2210
test-net9:
2311
runs-on: ubuntu-latest
2412
container: mcr.microsoft.com/dotnet/sdk:9.0
@@ -27,7 +15,7 @@ jobs:
2715
- name: Checkout
2816
uses: actions/checkout@v3
2917
- name: Build
30-
run: ./build.sh net9.0
18+
run: dotnet build
3119
- name: Test
32-
run: ./test.sh net9.0
20+
run: dotnet test
3321

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Authors>Cnblogs</Authors>

build.sh

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

src/Cnblogs.Architecture.Ddd.Cqrs.Abstractions/Cnblogs.Architecture.Ddd.Cqrs.Abstractions.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717

1818
<ItemGroup>
1919
<PackageReference Include="Mapster" Version="7.4.0" />
20-
</ItemGroup>
21-
22-
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
23-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.8" />
24-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.8" />
25-
</ItemGroup>
26-
27-
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
2820
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.8" />
2921
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.8" />
3022
</ItemGroup>

src/Cnblogs.Architecture.Ddd.Cqrs.Abstractions/CommandResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public record CommandResponse : IValidationResponse, ILockableResponse
2626
public string ErrorMessage { get; init; } = string.Empty;
2727

2828
/// <inheritdoc />
29-
public ValidationErrors ValidationErrors { get; init; } = new();
29+
public ValidationErrors ValidationErrors { get; init; } = [];
3030

3131
/// <inheritdoc />
3232
public bool LockAcquired { get; set; }

src/Cnblogs.Architecture.Ddd.Cqrs.Abstractions/ValidationErrors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Cnblogs.Architecture.Ddd.Cqrs.Abstractions;
77
/// </summary>
88
public class ValidationErrors : ICollection<ValidationError>
99
{
10-
private readonly List<ValidationError> _validationErrors = new();
10+
private readonly List<ValidationError> _validationErrors = [];
1111

1212
/// <summary>
1313
/// Add a new validation error.

src/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore.csproj

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
1111
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
12-
</ItemGroup>
13-
14-
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
15-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.19" />
16-
</ItemGroup>
17-
18-
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
19-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.19" />
12+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.8" />
2013
</ItemGroup>
2114

2215
<ItemGroup>

src/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore/CqrsRouteMapper.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@ namespace Cnblogs.Architecture.Ddd.Cqrs.AspNetCore;
1515
/// </summary>
1616
public static class CqrsRouteMapper
1717
{
18-
private static readonly List<Type> QueryTypes = new() { typeof(IQuery<>), typeof(IListQuery<>) };
18+
private static readonly List<Type> QueryTypes = [typeof(IQuery<>), typeof(IListQuery<>)];
1919

20-
private static readonly List<Type> CommandTypes = new() { typeof(ICommand<>), typeof(ICommand<,>) };
20+
private static readonly List<Type> CommandTypes = [typeof(ICommand<>), typeof(ICommand<,>)];
2121

22-
private static readonly string[] GetAndHeadMethods = { "GET", "HEAD" };
22+
private static readonly string[] GetAndHeadMethods = ["GET", "HEAD"];
2323

24-
private static readonly List<string> PostCommandPrefixes = new()
25-
{
24+
private static readonly List<string> PostCommandPrefixes =
25+
[
2626
"Create",
2727
"Add",
2828
"New"
29-
};
29+
];
3030

31-
private static readonly List<string> PutCommandPrefixes = new()
32-
{
31+
private static readonly List<string> PutCommandPrefixes =
32+
[
3333
"Update",
3434
"Modify",
3535
"Replace",
3636
"Alter"
37-
};
37+
];
3838

39-
private static readonly List<string> DeleteCommandPrefixes = new()
40-
{
39+
private static readonly List<string> DeleteCommandPrefixes =
40+
[
4141
"Delete",
4242
"Remove",
4343
"Clean",
4444
"Clear",
4545
"Purge"
46-
};
46+
];
4747

4848
/// <summary>
4949
/// Map a query API, using GET method. <typeparamref name="T"/> would been constructed from route and query string.

src/Cnblogs.Architecture.Ddd.Cqrs.Dapper.Clickhouse/ClickhouseContextCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Cnblogs.Architecture.Ddd.Cqrs.Dapper.Clickhouse;
55
/// </summary>
66
public class ClickhouseContextCollection
77
{
8-
internal List<Type> ContextTypes { get; } = new();
8+
internal List<Type> ContextTypes { get; } = [];
99

1010
internal void Add<TContext>()
1111
{

src/Cnblogs.Architecture.Ddd.Cqrs.MongoDb/MongoContextCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Cnblogs.Architecture.Ddd.Cqrs.MongoDb;
77
/// </summary>
88
public class MongoContextCollection
99
{
10-
private readonly List<Type> _contexts = new();
10+
private readonly List<Type> _contexts = [];
1111

1212
/// <summary>
1313
/// 添加一个 MongoContext。

0 commit comments

Comments
 (0)