Skip to content

Commit 52b5851

Browse files
committed
Update Roslynator, improve type clarity, and reformat code
Updated `Directory.Build.props` to change `Roslynator.Analyzers` version from `4.12.7` to `4.12.8`. Added a period to the comment in `ICommand.cs`. Explicitly used `string` type instead of `var` in `MongoOutboxInitializer.cs`. Reformatted `channel.ExchangeDeclare` calls and changed `foreach` loop variable to `string?` in `RabbitMqExchangeInitializer.cs` for better readability and type clarity.
1 parent 4e1a3ba commit 52b5851

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</PropertyGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="Roslynator.Analyzers" Version="4.12.7">
24+
<PackageReference Include="Roslynator.Analyzers" Version="4.12.8">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
</PackageReference>

src/Genocs.Core/CQRS/Commands/ICommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Genocs.Core.CQRS.Commands;
22

33
/// <summary>
4-
/// CQRS command interface
4+
/// CQRS command interface.
55
/// </summary>
66
public interface ICommand
77
{

src/Genocs.MessageBrokers.Outbox.MongoDB/Internals/MongoOutboxInitializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task InitializeAsync()
2828
return;
2929
}
3030

31-
var inboxCollection = string.IsNullOrWhiteSpace(_options.InboxCollection)
31+
string inboxCollection = string.IsNullOrWhiteSpace(_options.InboxCollection)
3232
? "inbox"
3333
: _options.InboxCollection;
3434

@@ -41,7 +41,7 @@ await _database.GetCollection<InboxMessage>(inboxCollection)
4141
ExpireAfter = TimeSpan.FromSeconds(_options.Expiry)
4242
}));
4343

44-
var outboxCollection = string.IsNullOrWhiteSpace(_options.OutboxCollection)
44+
string outboxCollection = string.IsNullOrWhiteSpace(_options.OutboxCollection)
4545
? "outbox"
4646
: _options.OutboxCollection;
4747

src/Genocs.MessageBrokers.RabbitMQ/Initializers/RabbitMqExchangeInitializer.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,24 @@ public Task InitializeAsync()
3636
if (_options.Exchange?.Declare == true)
3737
{
3838
Log(_options.Exchange.Name, _options.Exchange.Type);
39-
channel.ExchangeDeclare(_options.Exchange.Name, _options.Exchange.Type, _options.Exchange.Durable,
40-
_options.Exchange.AutoDelete);
39+
40+
channel.ExchangeDeclare(
41+
_options.Exchange.Name,
42+
_options.Exchange.Type,
43+
_options.Exchange.Durable,
44+
_options.Exchange.AutoDelete);
4145

4246
if (_options.DeadLetter?.Enabled is true && _options.DeadLetter?.Declare is true)
4347
{
44-
channel.ExchangeDeclare($"{_options.DeadLetter.Prefix}{_options.Exchange.Name}{_options.DeadLetter.Suffix}",
45-
ExchangeType.Direct, _options.Exchange.Durable, _options.Exchange.AutoDelete);
48+
channel.ExchangeDeclare(
49+
$"{_options.DeadLetter.Prefix}{_options.Exchange.Name}{_options.DeadLetter.Suffix}",
50+
ExchangeType.Direct,
51+
_options.Exchange.Durable,
52+
_options.Exchange.AutoDelete);
4653
}
4754
}
4855

49-
foreach (var exchange in exchanges)
56+
foreach (string? exchange in exchanges)
5057
{
5158
if (exchange.Equals(_options.Exchange?.Name, StringComparison.InvariantCultureIgnoreCase))
5259
{

0 commit comments

Comments
 (0)