I'm selecting some data from a source and I want to pass this to a generic method for handling the data. Each property I select needs a little bit of meta-data associated for processing. This is roughly what I'd like to be able to do:

```
var items = from i in db.bar
            select new {
                a = i.Prop1.ToString(),
                b = i.Prop2.ToString(),
                c = Prop3
            };

// Roughly what I would like to be able to do:
ProcessData(items,
    new DataSelector() { Header = "head1", Selector = (d => d.Prop1) },
    new DataSelector() { Header = "head2", Selector = (d => d.Prop2) });

```

The closest I can get is the following:

```
private class DataSelector<T> {
    public string Header { get; set; }
    public Func<T, string> Selector { get; set; }
}

private static void Process<T>(IEnumerable<T> stuff,
                               params ColumnDef<T>[] defs) {
    foreach (var item in stuff) {
         // Use all defs like...
         Console.WriteLine(defs[0].Header + ": " + defs[0].Selector(item));
    }
}

Process(items,
    new DataSelector<dynamic>() { Header = "head1", Selector = (d => d.Prop1) });

```

But this allows me to write `(d => d.NonExistantProp)` and it will compile and fail at runtime (boo, hiss). I can also do it for a single property and maintain type safety because the type seems to be worked out implicitly, but that won't let me pass sets of parameters:

```
private static void Process<T>(IEnumerable<T> stuff,
                               string header,
                               Func<T, string> selector) {
     // stuff happens
}

Process(items, "head1", (d => d.Prop1));

```

So... Is there a way to maintain compile-time type safety of the selector along with groups of related data?

Footnote: I appreciate I could have `Process<T>(IEnumerable<T> items, List<string> headers, params Func<T, string> selectors[])` but that also produces run-time errors if the headers don't pair up to the selectors.