All Tags » LINQ » C# (RSS)

Browse Site by Tags

Showing related tags and posts across the entire site.
  • Deferred execution gotchas

    I was trying to be clever the other day and try to chain assertions on an array: [ Test ] public void This_does_not_work() { var items = new [] {1, 2, 3, 4, 5}; items .Each(x => x.ShouldBeLessThan(0)) .Each(x => x.ShouldBeGreaterThan(10)); } I did this by writing an Each extension method that I've...
    Posted to Jimmy Bogard by bogardj on 08-13-2008
    Filed under: C#, LINQ
  • Some improved LINQ operators

    I ran across a couple of scenarios the other day that were made pretty difficult given the current LINQ query operators. First, I needed to see if an item existed in a collection. That's easy with the Contains method, when you want to find item that matches all the attributes you're looking for...
    Posted to Jimmy Bogard by bogardj on 06-07-2008
    Filed under: C#, LINQ
  • LINQ query operators: lose that foreach already!

    Now that .NET 3.5 is out with all its LINQ query operator goodness, I feel like going on a mean streak of trashing a lot of our (now) pointless foreach loops. Some example operations include: Transformations Aggregations Concatenations Filtering As I mentioned in my last post , temporary list creation...
    Posted to Jimmy Bogard by bogardj on 05-09-2008
    Filed under: C#, LINQ
  • Enhancing mappers with LINQ

    The "big 3" higher-order functions in functional programming are Filter, Map and Reduce. When looking at the new C# 3.0 LINQ query operators, we find that all three have equivalents : Filter = Where Map = Select Reduce = Aggregate Whenever you find yourself needing one of these three higher...
    Posted to Jimmy Bogard by bogardj on 05-08-2008
    Filed under: Domain-Driven Design, C#, LINQ
Page 1 of 1 (20 items)
Copyright Los Techies 2007, 2008. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems