Linq

FacebookTwitter

Extending DynamicLINQ language: Specifying class name in "new" clause

http://www.krizzcode.com/2012/01/extending-dynamiclinq-language.html Dynamic Linq (1) is a library provided in source code by Microsoft which provides dynamic linq capabilities - i.e. you can construct queries as strings instead of type-safe programming language constructs as in the default linq. The library provides additional extension methods for IQueryable like Where and Select which accept strings which represent queries which are parsed in the runtime into the adequate lambda expressions for linq expression tree. It allows you to write queries like the following:
http://www.hookedonlinq.com/BetweenOperator.ashx

Between Operator Sample - Hooked on LINQ

The Between operator is a sample Sequence operator that returns elements after a StartPredicate has been satisfied, until an End Predicate is satisfied. It is written as a sample and the operator could be implemented in alternative ways using the SkipWhile operator and the TakeWhile operators using a normal query. The only information we have on the source sequence is that it is IEnumerable The code behind this operator shows remarkable similarity to the Sequence.cs source code supplied by Microsoft as part of the MAY 2006 LINQ CTP.
If you take a quick detour over to StackOverflow , you’ll realize very, very quickly that, when it comes to wholly and full-heartedly screwing up your Linq to SQL statements, the screw-up almost always involves a misunderstanding of the purpose and the correct usage of Linq to SQL’s IQueryable interface. If we screw up our usage of IQueryable, we’re pissing super-hard in a very, very long MVC journey downstream: ... Whoops. I’ve spent the past couple of days perusing through blogs about Linq, and I’ve tried to gather together a handful of IQueryable Maxims.

IQueryable Can Kill Your Dog, Steal Your Wife, Kill Your Will To Live, etc. « weirdlover

http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/
http://www.albahari.com/nutshell/predicatebuilder.aspx

C# 4.0/3.0 in a Nutshell - PredicateBuilder

Dynamically Composing Expression Predicates Suppose you want to write a LINQ to SQL or Entity Framework query that implements a keyword-style search. In other words, a query that returns rows whose description contains some or all of a given set of keywords. We can proceed as follows: IQueryable<Product> SearchProducts (params string[] keywords) { IQueryable<Product> query = dataContext.Products; foreach (string keyword in keywords) { string temp = keyword; query = query.Where (p => p.Description.Contains (temp)); } return query; }
Introduction Very often, we have a requirement to display data in tabular form and manipulate it. In classic ASP.NET, built-in controls are available. It's always better to use custom scripts to solve this problem in ASP.NET MVC. jqGrid is one of such solutions.

Using jqGrid’s search toolbar with multiple filters in ASP.NET MVC

http://www.codeproject.com/Articles/58357/Using-jqGrid-s-search-toolbar-with-multiple-filter
LINQ (language integrated query) is one of the new features provided with VS 2008 and .NET 3.5. LINQ makes the concept of querying data a first class programming concept in .NET, and enables you to efficiently express queries in your programming language of choice. One of the benefits of LINQ is that it enables you to write type-safe queries in VB and C#. This means you get compile-time checking of your LINQ queries, and full intellisense and refactoring support over your code: While writing type-safe queries is great for most scenarios, there are cases where you want the flexibility to dynamically construct queries on the fly. For example: you might want to provide business intelligence UI within your application that allows an end-user business analyst to use drop-downs to build and express their own custom queries/views on top of data.

Dynamic LINQ (Part 1: Using the LINQ Dynamic Query Library)

http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx
In-Depth Five Tips to Improve LINQ to SQL Performance LINQ to SQL is a powerful technology that can do as much harm as good if it is mis-used.

LINQ to SQL: Five Steps to Better Performance

http://visualstudiomagazine.com/articles/2010/06/24/five-tips-linq-to-sql.aspx