Difference between revisions of "Microsoft LINQ"
From Richard's Wiki
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | * [http://visualstudiomagazine.com/blogs/tool-tracker/2011/11/seeing-the-sql.aspx Seeing the SQL Generated by LINQ to Entity Queries (Visual Studio Magazine)] | ||
* [[Media:Microsoft Press - Introducing Microsoft LINQ.zip]] | * [[Media:Microsoft Press - Introducing Microsoft LINQ.zip]] | ||
* [http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx LINQ to XML - 5 Minute Overview] | * [http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx LINQ to XML - 5 Minute Overview] | ||
* [http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx 101 Linq samples (MSDN)] | * [http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx 101 Linq samples (MSDN)] | ||
| + | * Linq extension method to flatten a hierarchy: | ||
| + | |||
| + | using System.Collections.Generic; | ||
| + | using System.Linq; | ||
| + | using Model.Entity; | ||
| + | namespace Util | ||
| + | { | ||
| + | public static class RatesWorksheetSectionExtensions | ||
| + | { | ||
| + | public static IEnumerable<RatesWorksheetSection> Flatten(this IEnumerable<RatesWorksheetSection> source) | ||
| + | { | ||
| + | return source.Concat(source.SelectMany(p => p.Children.Flatten())); | ||
| + | } | ||
| + | } | ||
| + | } | ||
Latest revision as of 19:38, 3 November 2011
- Seeing the SQL Generated by LINQ to Entity Queries (Visual Studio Magazine)
- Media:Microsoft Press - Introducing Microsoft LINQ.zip
- LINQ to XML - 5 Minute Overview
- 101 Linq samples (MSDN)
- Linq extension method to flatten a hierarchy:
using System.Collections.Generic;
using System.Linq;
using Model.Entity;
namespace Util
{
public static class RatesWorksheetSectionExtensions
{
public static IEnumerable<RatesWorksheetSection> Flatten(this IEnumerable<RatesWorksheetSection> source)
{
return source.Concat(source.SelectMany(p => p.Children.Flatten()));
}
}
}