EnumerableExtensions.cs 450 B

1234567891011121314151617181920
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Avalonia.Controls.UnitTests
  7. {
  8. internal static class EnumerableExtensions
  9. {
  10. public static IEnumerable<T> Do<T>(this IEnumerable<T> items, Action<T> action)
  11. {
  12. foreach (var i in items)
  13. {
  14. action(i);
  15. yield return i;
  16. }
  17. }
  18. }
  19. }