Quantcast
Channel: linq – adamprescott.net
Browsing latest articles
Browse All 8 View Live

Image may be NSFW.
Clik here to view.

Manipulating Objects in a Collection with LINQ

I was chatting with a co-worker about using LINQ to replace for-each loops. More specifically, we were discussing how to modify the properties of items in a collection or a subset of the collection. I...

View Article



Image may be NSFW.
Clik here to view.

Making Enumerable Collections LINQ-Queryable

LINQ is one of the greatest things that’s happened to Windows programming. I love it, and I use it all the time. Occasionally, you’ll run into an enumerable collection class that can’t be queried with...

View Article

Image may be NSFW.
Clik here to view.

Add Additional References in LINQPad

LINQPad is one of my favorite development tools. I use it all the time to do quick tests to verify thoughts or discussions that I’m having with peers. It’s terrific for building snippets for email and...

View Article

Image may be NSFW.
Clik here to view.

Joins in LINQ

The scenario: you have two related collections of objects, and you need to smush ‘em together into a collection of combined records. It’s easy to do with LINQ’s Join method, but Join can seem a little...

View Article

Image may be NSFW.
Clik here to view.

Collection Lookups

Yesterday, I was discussing a method with a co-worker where I suggested we loop through a collection of records and, for each record, do another retrieval-by-ID via LINQ. He brought up that this would...

View Article


Image may be NSFW.
Clik here to view.

Find Duplicate Database Entries with LINQPad

A co-worker and I were chatting about a code problem he was having that was likely due to duplicate entries in a database table. He thought that records in the table were unique based on two columns,...

View Article

Image may be NSFW.
Clik here to view.

Group Strings Using LINQ and Regular Expressions

I was working on a problem yesterday where I needed to combine strings that were the same except for one part. Here’s a simplified version of the problem: Input Array: "Adam likes apples." "Adam likes...

View Article

Image may be NSFW.
Clik here to view.

Simple .DistinctBy Extension

LINQ’s Distinct extension has largely been a disappointment to me. Sure, it’s nice when I’m working with a collection of integers, but more often than not, I’m working with a collection of objects and...

View Article

Browsing latest articles
Browse All 8 View Live




Latest Images