Skip to content

Commit c1caf63

Browse files
authored
Merge pull request #2 from cnblogs/clean-up-warnings
chore: cleanup project warnings
2 parents 373a8e2 + 22c0521 commit c1caf63

File tree

13 files changed

+28
-21
lines changed

13 files changed

+28
-21
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ indent_style = space
88
indent_size = 4
99

1010
# Microsoft .NET properties
11-
csharp_preferred_modifier_order = public, private, protected, internal, abstract, virtual, sealed, override, static, new, readonly, extern, unsafe, volatile, async:suggestion
11+
csharp_preferred_modifier_order = public, private, protected, internal, static, abstract, virtual, sealed, override, new, readonly, extern, unsafe, volatile, async:suggestion
1212
csharp_style_var_elsewhere = true:suggestion
1313
csharp_style_var_for_built_in_types = true:suggestion
1414
csharp_style_var_when_type_is_apparent = true:suggestion
@@ -45,7 +45,7 @@ resharper_keep_existing_initializer_arrangement = false
4545
resharper_keep_existing_invocation_parens_arrangement = false
4646
resharper_keep_existing_switch_expression_arrangement = false
4747
resharper_max_initializer_elements_on_line = 2
48-
resharper_modifiers_order = public private protected internal abstract virtual sealed override static new readonly extern unsafe volatile async
48+
resharper_modifiers_order = public private protected internal static abstract virtual sealed override new readonly extern unsafe volatile async
4949
resharper_place_accessorholder_attribute_on_same_line = false
5050
resharper_place_field_attribute_on_same_line = false
5151
resharper_place_linq_into_on_new_line = false

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<Authors>Cnblogs</Authors>
88
<Product>Cnblogs.Architecture</Product>
99
<PackageProjectUrl>https://github.com/cnblogs/Architecture</PackageProjectUrl>
10+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public static IEndpointConventionBuilder MapCommand<T>(
6969
/// </code>
7070
/// </example>
7171
/// <returns></returns>
72+
// ReSharper disable once UnusedTypeParameter
7273
public static IEndpointConventionBuilder MapCommand<T>(
7374
this IEndpointRouteBuilder app,
7475
[StringSyntax("Route")] string route,

src/Cnblogs.Architecture.Ddd.Cqrs.ServiceAgent/IApiException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public interface IApiException<out TException>
3131
/// <param name="message">错误信息。</param>
3232
/// <param name="userFriendlyMessage">给用户显示的错误信息。</param>
3333
[DoesNotReturn]
34-
abstract static void Throw(int statusCode = -1, string message = "", string? userFriendlyMessage = null);
34+
static abstract void Throw(int statusCode = -1, string message = "", string? userFriendlyMessage = null);
3535

3636
/// <summary>
3737
/// 创建异常。
@@ -40,5 +40,5 @@ public interface IApiException<out TException>
4040
/// <param name="message">错误信息。</param>
4141
/// <param name="userFriendlyMessage">给用户显示的错误信息。</param>
4242
/// <returns></returns>
43-
abstract static TException Create(int statusCode = -1, string message = "", string? userFriendlyMessage = null);
43+
static abstract TException Create(int statusCode = -1, string message = "", string? userFriendlyMessage = null);
4444
}

src/Cnblogs.Architecture.Ddd.EventBus.Abstractions/AssemblyAppNameAttribute.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
[AttributeUsage(AttributeTargets.Assembly)]
77
public class AssemblyAppNameAttribute : Attribute
88
{
9-
/// <inheritdoc />
9+
/// <summary>
10+
/// 配置应用名称。
11+
/// </summary>
12+
/// <param name="name">应用名称。</param>
1013
public AssemblyAppNameAttribute(string name)
1114
{
1215
Name = name;

src/Cnblogs.Architecture.Ddd.Infrastructure.EntityFramework/BaseRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public async Task<TEnumerable> AddRangeAsync<TEnumerable>(TEnumerable entities)
6666
return entities;
6767
}
6868

69-
/// <inheritdoc />
69+
/// <inheritdoc cref="IRepository{TEntity,TKey}.GetAsync" />
7070
public async Task<TEntity?> GetAsync(TKey key)
7171
{
7272
return await Context.Set<TEntity>().FirstOrDefaultAsync(e => e.Id.Equals(key));

src/Cnblogs.Architecture.Ddd.Infrastructure.MongoDb/MongoBaseRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public async Task<TEntity> DeleteAsync(TEntity entity)
7878
return entity;
7979
}
8080

81-
/// <inheritdoc />
81+
/// <inheritdoc cref="IRepository{TEntity,TKey}.GetAsync" />
8282
public async Task<TEntity?> GetAsync(TKey key)
8383
{
8484
return await Context.Set<TEntity>().Find(Builders<TEntity>.Filter.Eq(x => x.Id, key)).FirstOrDefaultAsync();

src/Cnblogs.Architecture.Ddd.Infrastructure.MongoDb/MongoContextOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace Cnblogs.Architecture.Ddd.Infrastructure.MongoDb;
77
/// MongoContext 的配置文件。
88
/// </summary>
99
/// <typeparam name="TContext">要配置的 MongoContext。</typeparam>
10+
// ReSharper disable once UnusedTypeParameter
1011
public class MongoContextOptions<TContext> : MongoContextOptions
1112
where TContext : MongoContext
1213
{

test/Cnblogs.Architecture.IntegrationTestProject/Application/Commands/CommandHandlers.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ public class CommandHandlers
88
ICommandHandler<DeleteCommand, TestError>
99
{
1010
/// <inheritdoc />
11-
public async Task<CommandResponse<TestError>> Handle(CreateCommand request, CancellationToken cancellationToken)
11+
public Task<CommandResponse<TestError>> Handle(CreateCommand request, CancellationToken cancellationToken)
1212
{
13-
return request.NeedError
13+
return Task.FromResult(request.NeedError
1414
? CommandResponse<TestError>.Fail(TestError.Default)
15-
: CommandResponse<TestError>.Success();
15+
: CommandResponse<TestError>.Success());
1616
}
1717

1818
/// <inheritdoc />
19-
public async Task<CommandResponse<TestError>> Handle(UpdateCommand request, CancellationToken cancellationToken)
19+
public Task<CommandResponse<TestError>> Handle(UpdateCommand request, CancellationToken cancellationToken)
2020
{
21-
return request.NeedError
21+
return Task.FromResult(request.NeedError
2222
? CommandResponse<TestError>.Fail(TestError.Default)
23-
: CommandResponse<TestError>.Success();
23+
: CommandResponse<TestError>.Success());
2424
}
2525

2626
/// <inheritdoc />
27-
public async Task<CommandResponse<TestError>> Handle(DeleteCommand request, CancellationToken cancellationToken)
27+
public Task<CommandResponse<TestError>> Handle(DeleteCommand request, CancellationToken cancellationToken)
2828
{
29-
return request.NeedError
29+
return Task.FromResult(request.NeedError
3030
? CommandResponse<TestError>.Fail(TestError.Default)
31-
: CommandResponse<TestError>.Success();
31+
: CommandResponse<TestError>.Success());
3232
}
3333
}

test/Cnblogs.Architecture.IntegrationTestProject/Application/Queries/GetStringQuery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
namespace Cnblogs.Architecture.IntegrationTestProject.Application.Queries;
44

5-
public record GetStringQuery() : IQuery<string>;
5+
public record GetStringQuery : IQuery<string>;

0 commit comments

Comments
 (0)