问题
I would like to build a custom LINQ Provider. Mostly for learning purposes, but it may be usefull in the future. I've heard it's not a simple thing to do, but...
Where are some good tutorials on writing a custom LINQ Provider?
回答1:
You also have this blog entry: Writing custom LINQ provider
回答2:
Matt Warren (one of the primary guys behind LINQ to SQL) probably has the best series of posts over on his blog at http://blogs.msdn.com/mattwar/
回答3:
It's more than not simple - it's really, really hard, I believe. (From what I've seen of the difficulties Frans Bouma has run into, for instance.) Things like the differences between how C# and VB handle method resolution make it trickier, along with VB's helper methods which can appear in the expression trees unexpectedly (to the uninitiated).
However, you might want to look at LINQ to Amazon and LINQ to Active Directory to see how they do things.
回答4:
You can try LinqExtender. It will enable you to get up with a LINQ provider in less time.
Please try the example where i have used it to make a simple provider like LINQToTwitter.
http://weblogs.asp.net/mehfuzh/archive/2009/01/01/creating-linqtotwitter-library-using-linqextender.aspx
回答5:
There's also this msdn tutorial: Walkthrough: Creating an IQueryable LINQ Provider
回答6:
Try here also
http://blogs.msdn.com/tommer/archive/2007/04/20/building-custom-linq-enabled-data-providers-using-iqueryable-t.aspx
回答7:
Being someone that is in the process of writing a LINQ provider I can tell you that the best way is the look at existing ones that are available and reverse engineer them.
A good project I came across (which is still in its infancy) is LINQ to TFS and it's simple and it's good to get started.
I also have read a lot of the code for the LINQ to SharePoint as it's got both the source and unit tests so you can see how it operates.
来源:https://stackoverflow.com/questions/252751/where-are-some-good-tutorials-on-writing-a-custom-linq-provider