开发者

Weakly typed LINQ to Relational Data

开发者 https://www.devze.com 2023-01-09 11:16 出处:网络
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?

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

精彩评论

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