There are many LINQ implementations such as LINQ-to-Flickr. To make something like this, do I make my own custom LINQ provider?
Thanks
Have a look at this tutorial
Aha. That's the only way.
Hit in google 'write LINQ provider'. There are many tutorials out there.
Start with understanding what exactly Expression is, how it differs from lambdas and how to work with them.
I find this book quite helpful too (at least - beginning).
Yes, to get started, the best place is looking at the IQToolkit on Codeplex. You'll learn a lot about how it works.
If you do find you need to build your own then look at IQToolKit and the The Wayward Weblog for a full series on how to do it.
Related
Out of curiosity, i tried a few tutorials on code.org.
I began with this one.
Have you seen this graphical syntax using blocks ?
Is it some kind of standard ?
Or is completely home made ?
Here is what it looks like :
http://files.websitetoolbox.com/149581/1788549
Where can i learn more about it ?
I think it is really easy to read, and i wonder if i could use somewhere else, programming c# or c++, java, even javascript.
I am still not sure if business code would really be easy to read using this syntax.
It's likely to be some form of OpenBlocks, it's a way of representing your code and what it does in a more intuitive fashion, you can read more about it at the link I posted as a comment.
Notably, a similar solution was in use for creating Android apps too .
This is called blockly. You can find a lot of information from blockly's FAQ. Hope that helps.
I need a good reference for how to use standard Libraries in Ruby. Current libraries do not describe or give examples like say Java's. Yet this is where examples are much more needed (in Ruby), because I am not familiar with what the called method will yield! I am left with having to look at the source files every time, which seems inefficient. What is a good standard library reference... or am I just not understanding blocks yet?
I find myself bouncing around between the ruby core API on ruby-doc.org, googling for answers on random blogs, and spending time testing ideas in the interactive interpreter (irb). I haven't seen any other core reference documentation that I liked, but I do have a copy of The Ruby Way and its pretty decent.
Betweeen these four sources I can almost always find out how to solve the problem I'm working on.
Best of luck - ruby is fun, frustrating, and powerful.
There is the Ruby Standard Library documentation and sites like apidock. The Pickaxe book has a great reference towards the end. There's even a free version online, but it's quite out of date; to find the reference there, click Standard Library in the top-left frame.
Try GotAPI You'll be able to find the Ruby standard documentation and a whole lot of api docs there
Understanding blocks is pretty important, especially if you want to understand the Enumerable module. ruby-doc.org is usually all I need, but if I need a little more explanation I grab the PickAxe. You need the PickAxe, no question.
I am sorry , but again, i have to recommend ruby cookbook. (Already two times today)
I'm looking to learn LINQ, but I'm finding that there is a lot more to it then what I initally expected. In fact, there's so much that I'm not sure where is the best place to start. I know that there's LINQ to SQL, and LINQ to Entities, and a number of other LINQ whatevers out there.
Which is the best to start with? It seems that I see more information readily available about LINQ to SQL, but I have seen quite a bit of information about LINQ to Entities also. Is LINQ to Entities more difficult than LINQ to SQL?
Also, I'm looking for some good resources on learning LINQ. I've seen that Scott Gu has a few blogs on LINQ to SQL, but I'm looking for a little more. Does anyone have a LINQ book that they're impressed with?
LINQ Pad is a good way to start learning, its also free...
http://www.linqpad.net/
I have been looking quite alot for the same, but i have found that there isnt really a place where everything is together..
But there is a few good resources.
LinQ 101 - http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx
And this one got quite a few small example snippets on how to do things in alot of different languages.
And it got a section for linq too
http://www.java2s.com/Code/CSharp/LINQ/CatalogLINQ.htm
Id say start with linq to sql, they stopped developing that a while back, but the syntax is exactly like linq to entities, linq to entities and linq to sql is almost the same, there is a few things different, but id say start from the "bottom" :)
This is a really good tutorial about how to jump from "linq to sql" to "linq to entities"
http://naspinski.net/post/Getting-started-with-Linq-To-Entities.aspx
In the beginning, I found Standard Query Operators (MS Word .doc) an invaluable reference.
Pro LINQ by Joseph Rattz is a great book on the subject, although it doesn't cover LINQ to Entities.
As well as in depth examples for each of the standard query operators, it covers:
LINQ to Objects
LINQ to XML
LINQ to DataSet
LINQ to SQL
Although this isn't free, and might seem "daunting" to a beginner. But the Professional LINQ book published by Wrox I found was good as a "get your feet wet" book. It's not what I would consider part of their professional series despite the title and doesn't go into nearly as much depth as it should, but it's a good start nevertheless.
This book/ebook is very good also. Very good for starters.
http://www.manning.com/marguerie/
Here's a great site for practicing it (and also c#).
It still doesn't have LOTS of questions, but there are just enough to get you going (and you can also add questions yourself).
The next best thing to a personal beginner LINQ tutor:
http://www.asp.net/LEARN/linq-videos/
Another good way to learn LINQ is by browsing through code examples, and try them out on your own, if time permits.
Here are two of my personal favorite LINQ resources, which both have easy to understand code examples, and in my view are great for the beginner:
http://linqsamples.com
and
http://www.dotnetperls.com/linq
I am developing my first ASP.NET MVC application using the Entity Framework. I have no previous .NET experience, although I'm fluent in other OO languages. I am having trouble understanding Linq to Entity query expressions, more specifically its syntax and how to render the results on an ASP page.
For example, I am joining three tables (entities) together and trying to iterate over the results, but I get all sorts of type errors. Every example I find on Google, SO, or MSFT hasn't been straightforward and each site takes their own approach. I looked at the book Programming Entity Framework, but this too seems to be over my head at the moment.
I am looking for clear, concise examples of executing the equivalent of complex multiple joins and iterating over the results.
Thanks
I've just started this myself, and I bought both the wrox book and the o'reilly one.
I've found the wrox one a little more inaccessible - the language used in it is a bit heavier, and the layout/organisation isn't quite so 'flowy' (is that a word? hehe).
The o'reilly one on the other hand is a cracking read, and really does lead you nicely through it. It's available on safaribooks too if you have a sub, I got it from Amazon who seemed one of the few places to have it in stock. Very much recommended.
take a look at these samples - http://blogs.msdn.com/adonet/archive/2007/03/13/101-linq-samples-updated.aspx
i picked up the concept from these examples itself
Scott Guthrie's blog has also really good explanation & samples
Sounds to me like you should get yourself a good book on the subject. Since you have no previous experience in .NET a general book that covers LINQ might be a start and then a ASP.NET-MVC specific one.
Perhaps the reason why being fluent in "other" OO languages isn't helping is that LINQ isn't an OO language, its much more functional and therefore takes a different way of reasoning to understand well.
How easy would it be to write a dumb LINQ provider that can just use my class definitions (which don't have any object references as properties) and give me the translated SQL. It can assume the name of the properties and the columns to be same as well as the names of the classes and the underlying tables. Can you please give me some pointers.?
It took me about 4 months of fulltime work (8 hours a day) to build a stable, working provider that implements the entire spec of linq. I would say I had a very simple, buggy and unstable version after about three weeks, so if you're just looking for something rough I would say you're probably looking at anything from a week up to two months depending on how good you are and what types of requiements you have.
I must point you to the Wayward blog for this, Matt has written a really good walkthrough on how to implement a linq provider, and even if you're probably not going to be able to copy and paste, it will help you to get to grips with how to think when working. You can find Matt´s walkthrough here: http://blogs.msdn.com/mattwar/archive/2007/07/30/linq-building-an-iqueryable-provider-part-i.aspx . I recommend you go about it the same way Matt does, and extend the expression tree visitor Matt includes in the second part of his tutorial.
Also, when I began working with this, I had so much help from the expression tree visualizer, it really made parsing a whole lot easier once you could see how linq parsed to queries.
Building a provider is really a lot of fun, even if a bit frustrating at times. I wish you all the best of luck!
Give a look to the LINQExtender project, is a toolkit for creating custom LINQ providers.
Another option for giving you a leg up seems to be re-linq which is a framework for creating custom LINQ providers.
Here's the Source code and a nice overview (pdf) of what's involved in writing one.
I’ve written a tutorial series on my blog base on my experience developing a LINQ-to-SQL provider from scratch, starting with the expression tree composition stage (calling the LINQ methods), continuing with the expression visitor, breaking down of the query into components, parsing the where clause, generating the text and parameter and, eventually, compiling the whole thing into IL using the .NET expression namespace.
I’ve seen many incomplete posts that promised to explain how to write a provider, falling very short of the mark, barely scratching the surface and not actually delivering anything remotely executable.
The blog series I’ve written based on my experience has a sample project available for download with the simple provider that covers only the functionality required by the tutorial example. However, it also includes the production version supporting a number of operations (where, join, first, count, top, etc.), subqueries, nested statements, and etc. Additionally, it produces a cleaner SQL than a lot of what I’ve seen from Entities and LINQ-to-SQL. There’s no unnecessary/redundant nesting, wrapping everything in brackets and etc.
For anyone with a good level of abstract thinking, developing such a provider isn’t such a difficult task many set it out to be. I’ve developed one that’s used in production environment in about 3 months of part time work (meaning some evenings and weekends). From the get go it was aimed with performance and tidy SQL in mind – a goal it achieved.
It was a little hard to find the time to publish this material, but I thought – if it may help someone out there, there’s no reason for this experience to go to waste:
How to write a LINQ to SQL provider in C# Part 1 - Introduction
How to write a LINQ to SQL provider in C# Part 2 - Expression Visitor
How to write a LINQ to SQL provider in C# Part 3 - Where Clause Visitor
How to write a LINQ to SQL provider in C# Part 4 - Compiling Expression Trees
I have created a project 'LinqToAnything' which is designed to make it very very easy to implement a (simple) Linq provider.