开发者

Weakly typed LINQ to Relational Data

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["P开发者_StackOverflow中文版ersons"]
    .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.


How about Dynamic LINQ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜