Skip to content

Commit

Permalink
Use C# 12 collection expressions (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
bording committed Sep 15, 2023
1 parent 7077416 commit 917298e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static void SetEntry(ContextBag context, Guid sagaId, Entry value)
{
if (context.TryGet(ContextKey, out Dictionary<Guid, Entry> entries) == false)
{
entries = new Dictionary<Guid, Entry>();
entries = [];
context.Set(ContextKey, entries);
}
entries[sagaId] = value;
Expand Down
4 changes: 2 additions & 2 deletions src/NServiceBus.Testing/Sagas/TestableSaga.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public TestableSaga(Func<TSaga> sagaFactory = null, DateTime? initialCurrentTime
queue = new Queue<QueuedSagaMessage>();
persister = new NonDurableSagaPersister();
storedTimeouts = new List<(DateTime, OutgoingMessage<object, SendOptions>)>();
replySimulators = new Dictionary<Type, List<(Type, Func<object, object>)>>();
replySimulators = [];

sagaMapper = SagaMapper.Get<TSaga, TSagaData>(this.sagaFactory);
}
Expand Down Expand Up @@ -198,7 +198,7 @@ public Task<HandleResult> HandleQueuedMessage(TestableMessageHandlerContext cont
if (!replySimulators.TryGetValue(
typeof(TSagaMessage), out List<(Type ReplyMessageType, Func<object, object> SimulateReply)> simulators))
{
simulators = new List<(Type ReplyMessageType, Func<object, object> SimulateReply)>();
simulators = [];
replySimulators.Add(typeof(TSagaMessage), simulators);
}

Expand Down

0 comments on commit 917298e

Please sign in to comment.