Skip to content

Commit 7c68fc1

Browse files
authored
Add ToArray() to ConcurrentObservableCollection (#1256)
* Add ToArray() to ConcurrentObservableCollection * ---
1 parent e7d442e commit 7c68fc1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/WireMock.Net/Server/WireMockServer.LogEntries.cs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public event NotifyCollectionChangedEventHandler LogEntriesChanged
2626
[PublicAPI]
2727
public IReadOnlyList<ILogEntry> LogEntries => _options.LogEntries.ToArray();
2828

29-
3029
/// <inheritdoc />
3130
[PublicAPI]
3231
public IReadOnlyList<ILogEntry> FindLogEntries(params IRequestMatcher[] matchers)

src/WireMock.Net/Util/ConcurrentObservableCollection.cs

+8
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,12 @@ public List<T> ToList()
8484
return Items.ToList();
8585
}
8686
}
87+
88+
public T[] ToArray()
89+
{
90+
lock (_lockObject)
91+
{
92+
return Items.ToArray();
93+
}
94+
}
8795
}

0 commit comments

Comments
 (0)