Skip to content

Commit a6be96a

Browse files
Remove namespace declaration to make it consistent with rest of snippets project. (#7733)
1 parent 938bd5d commit a6be96a

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

Snippets/ASQ/ASQN_14/AccessToNativeMessage.cs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,24 @@
33
using Azure.Storage.Queues.Models;
44
using NServiceBus.Pipeline;
55

6-
namespace ASQN_13
6+
public class AccessToNativeMessage
77
{
8-
public class AccessToNativeMessage
9-
{
10-
#region access-native-incoming-message
8+
#region access-native-incoming-message
119

12-
class DoNotAttemptMessageProcessingIfMessageIsNotLocked : Behavior<ITransportReceiveContext>
10+
class DoNotAttemptMessageProcessingIfMessageIsNotLocked : Behavior<ITransportReceiveContext>
11+
{
12+
public override Task Invoke(ITransportReceiveContext context, Func<Task> next)
1313
{
14-
public override Task Invoke(ITransportReceiveContext context, Func<Task> next)
15-
{
16-
var NextVisibleOnUtc = context.Extensions.Get<QueueMessage>().NextVisibleOn;
17-
18-
if (NextVisibleOnUtc <= DateTime.UtcNow)
19-
{
20-
return next();
21-
}
14+
var NextVisibleOnUtc = context.Extensions.Get<QueueMessage>().NextVisibleOn;
2215

23-
throw new Exception($"Message lock lost for MessageId {context.Message.MessageId} and it cannot be processed.");
16+
if (NextVisibleOnUtc <= DateTime.UtcNow)
17+
{
18+
return next();
2419
}
25-
}
2620

27-
#endregion
21+
throw new Exception($"Message lock lost for MessageId {context.Message.MessageId} and it cannot be processed.");
22+
}
2823
}
29-
}
24+
25+
#endregion
26+
}

0 commit comments

Comments
 (0)