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?
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?
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/
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.
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.
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.