1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

List.ClearAndDispose

This commit is contained in:
Brian Fiete 2024-03-22 07:45:45 -04:00
parent 039e462bfe
commit 757d6e09aa

View file

@ -1182,6 +1182,16 @@ namespace System.Collections
}
}
extension List<T> where T : IDisposable
{
public void ClearAndDisposeItems()
{
for (var item in this)
item.Dispose();
Clear();
}
}
extension List<T> where T : String
{
public bool Contains(T item, StringComparison comparison)