public static IEnumerable<T> ForEach<T>(this  IEnumerable<T> source, Action<T> action) where T : class,new()
        {
            foreach (var item in source)
            {
                action(item);
                yield return item;
            }
        }

 

        public static void ForEach<T>(this  IEnumerable<T> source, Action<T> action) where T : class,new()
        {
            foreach (var item in source)
            {
                action(item);
            }
        }

 

 

相关文章:

  • 2021-12-29
猜你喜欢
  • 2021-07-29
  • 2022-01-28
  • 2022-12-23
  • 2021-07-01
相关资源
相似解决方案