Skip to content

Commit 72ccef0

Browse files
author
Anders Tøgersen (Delegate)
committed
Added XML comments to public interfaces
Changed accessors for classes Added coding rules for uninstantiated classes Exposed internal classes to Test assembly
1 parent 2b73a47 commit 72ccef0

17 files changed

+49
-23
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,4 +506,5 @@ dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net
506506
dotnet_diagnostic.CA1062.severity = none # Do not demand null-checking when using nullable reference types.
507507
dotnet_diagnostic.SA1011.severity = none # Space needed after closing square bracet "]" needed for nullable arrays
508508
dotnet_diagnostic.SA1401.severity = none # Field should be private
509-
dotnet_diagnostic.CA1051.severity = none # Do not declare visible instance fields
509+
dotnet_diagnostic.CA1051.severity = none # Do not declare visible instance fields
510+
dotnet_diagnostic.CA1812.severity = none # Internal classes are instantiated by IoC

sample/SampleApi/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
builder.Services.AddSingleton<SendDataHandler>();
1313

1414
// Register Atc.Azure.Messaging dependencies
15-
builder.Services.ConfigureMessagingServices(builder.Configuration); // ConfigureMessagingServices(builder.Configuration, true)
15+
var useManagedIdentity = false;
16+
builder.Services.ConfigureMessagingServices(builder.Configuration, useManagedIdentity);
1617

1718
var app = builder.Build();
1819
app.UseHttpsRedirection();

src/Atc.Azure.Messaging/EventHub/EventHubCredentialsPublisherFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Atc.Azure.Messaging.EventHub;
1212
"Reliability",
1313
"CA2000:Dispose objects before losing scope",
1414
Justification = "EventHubPublisher is responsible for disposing EventHubProducerClient")]
15-
public class EventHubCredentialsPublisherFactory : IEventHubPublisherFactory
15+
internal sealed class EventHubCredentialsPublisherFactory : IEventHubPublisherFactory
1616
{
1717
private readonly string fullyQualifiedNamespace;
1818
private readonly DefaultAzureCredentialOptions credentialOptions;

src/Atc.Azure.Messaging/EventHub/EventHubPublisher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Atc.Azure.Messaging.EventHub;
77

8-
public sealed class EventHubPublisher : IEventHubPublisher
8+
internal sealed class EventHubPublisher : IEventHubPublisher
99
{
1010
private readonly EventHubProducerClient client;
1111

src/Atc.Azure.Messaging/EventHub/EventHubPublisherFactory.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using Atc.Azure.Options.EventHub;
23
using Azure.Messaging.EventHubs.Producer;
34

45
namespace Atc.Azure.Messaging.EventHub;
56

6-
#pragma warning disable CA2000 // Dispose objects before losing scope
7-
8-
public class EventHubPublisherFactory : IEventHubPublisherFactory
7+
[SuppressMessage(
8+
"Reliability",
9+
"CA2000:Dispose objects before losing scope",
10+
Justification = "EventHubPublisher is responsible for disposing EventHubProducerClient")]
11+
internal sealed class EventHubPublisherFactory : IEventHubPublisherFactory
912
{
1013
private readonly string connectionString;
1114

src/Atc.Azure.Messaging/EventHub/IEventHubPublisher.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
namespace Atc.Azure.Messaging.EventHub;
1+
namespace Atc.Azure.Messaging.EventHub;
22

3+
/// <summary>
4+
/// Publisher responsible for publishing objects with metadata to a specific EventHub.
5+
/// </summary>
6+
/// <remarks>
7+
/// Is safe to cache and use in singletons for the lifetime of the application.
8+
/// </remarks>
39
public interface IEventHubPublisher : IAsyncDisposable
410
{
511
Task PublishAsync(

src/Atc.Azure.Messaging/EventHub/IEventHubPublisherFactory.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace Atc.Azure.Messaging.EventHub;
22

3+
/// <summary>
4+
/// Factory responsible for creating <see cref="IEventHubPublisher"/>s for a specific EventHub namespace.
5+
/// </summary>
36
public interface IEventHubPublisherFactory
47
{
58
IEventHubPublisher Create(string eventHubName);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using Azure.Messaging.ServiceBus;
1+
using Azure.Messaging.ServiceBus;
22

33
namespace Atc.Azure.Messaging.ServiceBus;
44

5-
public interface IServiceBusClientFactory
5+
internal interface IServiceBusClientFactory
66
{
77
ServiceBusClient Create();
88
}

src/Atc.Azure.Messaging/ServiceBus/IServiceBusPublisher.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace Atc.Azure.Messaging.ServiceBus;
22

3+
/// <summary>
4+
/// Publisher responsible for publishing objects with metadata to a specific ServiceBus.
5+
/// </summary>
36
public interface IServiceBusPublisher
47
{
58
Task PublishAsync(

src/Atc.Azure.Messaging/ServiceBus/IServiceBusSenderProvider.cs

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

33
namespace Atc.Azure.Messaging.ServiceBus;
44

5-
public interface IServiceBusSenderProvider
5+
internal interface IServiceBusSenderProvider
66
{
77
ServiceBusSender GetSender(string topicName);
88
}

0 commit comments

Comments
 (0)