static class Extension
  {
  public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
  {
  foreach (var x in source)
  {
  action(x);
  }
  }  public static System.Data.DataTable SelectWith(this DataTable sourceTable, Predicate<DataRow> predicateCondition)
  {
  DataTable resultTable = sourceTable.Clone();
  sourceTable.Rows.OfType<DataRow>().Where(s => predicateCondition(s)).ForEach(s => resultTable.ImportRow(s));  return resultTable;
  }
  }如何用VB.NET改写?
我试着改写了一下,如下,但是总是在编译的时候出现一个 Expression does not produce a value. 的错误,该如何改正?多谢Imports System
Imports System.Runtime.CompilerServices
Imports System.DataPublic Module Extension
  <Extension()> _
  Public Sub ForEach(Of T)(ByVal source As IEnumerable(Of T), ByVal action As Action(Of T))
  For Each x In source
  action(x)
  Next
  End Sub  <Extension()> _
  Public Function SelectWith(ByVal dt As DataTable, ByVal predicateCondition As Predicate(Of DataRow)) As DataTable
  Dim resultTable As New DataTable()
  resultTable = dt.Clone()
  dt.Rows.OfType(Of DataRow).Where(Function(row) predicateCondition(row)).ForEach(Function(row) resultTable.ImportRow(row))  Return resultTable
  End Function
End Module