I\'m trying to create a generic extension method, that works on typed data tables :
public static class Extensions
{
public static TableType DoSomething&
Even if that wasn't ideal, I gave up trying to return anything at all which allows me to do something like the following:
public static void DoSomething(this TypedTableBase table, param Expression>[] predicates)
where RowType : DataRow
{
// do something to each row of the table where the row matches the predicates
// do not return the table... too bad for chaining commands
}
And then use it like so:
MyTypedDataSet.MyTypedDataTable table = new MyTypedDataSet.MyTypedDataTable();
table.DoSomething(row => row.Field1 == "foo"));
and the compiler infers the type correctly.
Thank you both for your answers.