How do you extend Linq to SQL?

前端 未结 4 1743
终归单人心
终归单人心 2021-02-20 02:08

Last year, Scott Guthrie stated “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation

相关标签:
4条回答
  • 2021-02-20 02:50

    You want to translate an expression tree into SQL... You need to implement your own IQueryProvider

    IQueryProvider Reference
    How To

    MSDN How To

    0 讨论(0)
  • 2021-02-20 02:52

    DataContext x = new DataContext

    Something like this perhaps?

    var a = x.Where().with()...etc

    It lets you have a much finer control over the SQL.

    0 讨论(0)
  • 2021-02-20 02:55

    The ability to change the underlying provider and thus modify the SQL did not make the final cut in LINQ to SQL.

    0 讨论(0)
  • 2021-02-20 02:57

    Matt Warren's blog has everything you need for that:

    http://blogs.msdn.com/mattwar/

    0 讨论(0)
提交回复
热议问题