By tag: linq
0
kicks
Extending LINQ with Random Operations
Here's some code I wrote to extend LINQ with random operations like selecting a random item from a list and shuffling a list.
0
kicks
A LINQ Operator to Select Multiple Values from Sequences
Language-Integrated Query (LINQ) includes several projection operators but none that allow multiple items to be created from each item in a sequence. This article describes a custom operator that allows several selections to be made per item.
0
kicks
Batched Future Queries for LinqToSql, available via NuGet
Future queries are an unobtrusive and easy to use way of batching database queries into a lazy loaded data structures. Future queries were originally a feature of NHibernate, and have since been ported to other ORMs. To batch queries together, simply call the ToFuture extension method on your IQuery...
0
kicks
Caching LINQ Results
A discussion on when and if LINQ query results should be materialized, and a way to cache the results lazily to prevent multiple enumerations of the source.
0
kicks
Creating a data layer using LINQ to XML
Create an abstract application that will perform CRUD operations on XML using LINQ to XML
0
kicks
Modifying LINQ to SQL command text without Reflection
Following my post last year about modifying LINQ to SQL command text (evil, as it calls private methods through reflection) here’s an equally evil, but faster version that pre-compiles most of its work through an expression tree.
0
kicks
Modifying LINQ to SQL command text (again)
Last year I posted an article about modifying LINQ to SQL (L2S) command text. Here’s an update that properly handles sub-queries.
0
kicks
Don't use joins in Linq
One of the greatest benefits of LINQ to SQL and LINQ to Entities are navigation properties that allow queries across several tables, without the need to use explicit joins. The resulting code is much more readable, and the SQL generated by both Linq queries is identical.
0
kicks
Recursive Methods in Expression Trees
Writing a recursive method in C# is easy, but it’s not immediately obvious how to do the same in a LINQ expression tree. Here's how.
0
kicks
Tired of querying in antiquated SQL? don't have a DBMS handy?
This amazing small tool allows to query SQLSERVER or MYSQL databases using LINQ or simple SQL, doesn't require installation, and works like a charm, really useful if you're trying to learn LINQ. It's just 4MB
0
kicks
String Matching in LINQ
Performing simple string equality tests is often not enough when application user convenience is key. Often only a fragment of a string is known to the user, or many of them. Sometimes there is a need to search for a fragment in multiple columns.
Which options does OpenAccess and LINQ provide to pe...
0
kicks
Difference between SkipWhile and Where in linq
Before some time I have written a blog post about the SkipWhile operator and a reader of my blog asked me that we can do the same thing with Where also but there is a difference between this two. So In this post I am going to explain you difference between those two.
Where operator filters a list...
0
kicks
TakeWhile operator in linq
In this post I am going to explain TakeWhile Operator in details. TakeWhile is one of partitioning operator available in Linq. It will take sequence until condition becomes false.
0
kicks
SkipWhile Method in Linq
I have been playing around linq and I have found great method call SkipWhile method. SkipWhile methods skips particular element which matches condition in predicate this can be use full in condition where we need to skip elements on particular condition.
So let’s take some example. I have written...
0
kicks
A LINQ Style Range Generator
Language-Integrated Query (LINQ) provides the Enumerable.Range method that generates incrementing sequences of integers. This article describes a similar method that allows the creation of more complex ranges with the repeated application of a function.