Skip to content

Commit 2b73a47

Browse files
author
Anders Tøgersen (Delegate)
committed
Added SupressMessage with justification for CA2000
1 parent de2e415 commit 2b73a47

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using Atc.Azure.Options.Authorization;
23
using Atc.Azure.Options.Environment;
34
using Atc.Azure.Options.EventHub;
@@ -7,8 +8,10 @@
78

89
namespace Atc.Azure.Messaging.EventHub;
910

10-
#pragma warning disable CA2000 // Dispose objects before losing scope
11-
11+
[SuppressMessage(
12+
"Reliability",
13+
"CA2000:Dispose objects before losing scope",
14+
Justification = "EventHubPublisher is responsible for disposing EventHubProducerClient")]
1215
public class EventHubCredentialsPublisherFactory : IEventHubPublisherFactory
1316
{
1417
private readonly string fullyQualifiedNamespace;
@@ -26,7 +29,7 @@ public EventHubCredentialsPublisherFactory(
2629
environmentOptions,
2730
clientCredentialOptions);
2831
}
29-
32+
3033
public IEventHubPublisher Create(string eventHubName)
3134
=> new EventHubPublisher(
3235
new EventHubProducerClient(

0 commit comments

Comments
 (0)