Showing posts with label LINQ. Show all posts
Showing posts with label LINQ. Show all posts

Monday, February 9, 2009

LINQ Plugin for jQuery

Original url: http://plugins.jquery.com/project/jLINQ


If you've used the .NET Framework, chances are you've also used LINQ. The features found in LINQ allow you to work with collections in-memory to query, sort and manage data, much like you would with a SQL command. LINQ also allows you to connect directly to a database to manage records all within your IDE.

jLINQ works like .NET LINQ and lets you use commands to query collections that are in memory. jLINQ copies many of the same commands you find in LINQ like skip or take along with certain aggregate functions like sum.

So how does it work? Check out some of the code below.


var results = $.from(data)
.ignoreCase()
.startsWith("firstName","m")
.or("n")
.isNot("administrator")
.orderBy("lastName")
.select();


And that's it! You are returned a nice neat list of values matching what you entered. View the sample for more about the methods and commands!



JSINQ - LINQ to Objects for JavaScript

JSINQ is the JavaScript library that allows you to write SQL-like queries against arrays and DOM node lists.

JSINQ is a complete implementation of LINQ to Objects in JavaScript. What that means is that if you know LINQ and you know JavaScript, you know JSINQ. JSINQ is both an API-compatible implementation of System.Linq.Enumerable and a complete query-expression compiler. That's right: you can write LINQ-style queries in JavaScript. And if that isn't enough: JSINQ is also very liberally licensed, well-document, reasonably well-tested (the Enumerable-part) and currently in beta. So give it a go!

Try JSINQ here
Download JSINQ here