views:

49

answers:

1

Strong typing is fine and dandy when you know what your schema is going to look like at compile time. But what if you're working on an application that lets the user define their own schema?

Is there a reliable relational LINQ provider out there that operates at the same level of abstraction as LINQ to XML?

Example:

var whoIsJohnGalt = db.Tables["Persons"]
    .Where( row => row["First Name"] == "John" && row["LastName"] == "Galt")
    .Select( row => row["Bio"] );

LINQ to DataSet doesn't count because it's not that much different from LINQ to Objects: it requires the dataset to be pre-filled.

Many PHP frameworks (e.g. Zend_Table, CakePHP's models) operate in this manner, so it's not entirely infeasible. But if no such tool exists, I'm probably better off with raw ADO.net than with strongly-typed code generation.

A: 

How about Dynamic LINQ?

Jay
Not that C# has dynamic typing, does it still make sense to use that?
Jonathan Allen
Almost any language can do dynamic typing if you implement something similar to a Dictionary (a.k.a. a map, a hash map, an associative array, etc.)
MapDot