Add ToArray() to ConcurrentObservableCollection (#1256)

* Add ToArray() to ConcurrentObservableCollection

* ---
This commit is contained in:
Stef Heyenrath
2025-02-27 07:12:05 +01:00
committed by GitHub
parent e7d442e5ac
commit 7c68fc1d94
2 changed files with 8 additions and 1 deletions

View File

@@ -26,7 +26,6 @@ public partial class WireMockServer
[PublicAPI]
public IReadOnlyList<ILogEntry> LogEntries => _options.LogEntries.ToArray();
/// <inheritdoc />
[PublicAPI]
public IReadOnlyList<ILogEntry> FindLogEntries(params IRequestMatcher[] matchers)

View File

@@ -84,4 +84,12 @@ internal class ConcurrentObservableCollection<T> : ObservableCollection<T>
return Items.ToList();
}
}
public T[] ToArray()
{
lock (_lockObject)
{
return Items.ToArray();
}
}
}