Click here to Skip to main content
15,914,163 members
Everything / Ienumerable

Ienumerable

IEnumerable

Great Reads

by Muraad Nofal
A haskell monad/(applicative)functor like interface in C# that extends IEnumerable.
by Kabwla.Phone
Ha! I get it....I am actually using an adaptation of this technique in production code.But the adapted code required a dept-first search and this original pattern is width-first.Which brings us these new and improved versions:public static List FindControlsWidthFirst( Control...
by Namlak
string blah = string.Join(",", cities.Select(c=> c.Name));
by ASP.NET Community
The iterator pattern’s role is to provide a way to access aggregate objects sequentially without the knowledge of the structure of the aggregate.

Latest Articles

by Mike-MadBadger
This is an alternative for "Pick Your Enumerator & Me.Understand Yield and IEnumerable (C#)"
by Ramesh Bevara
An overview of a helper class to build dynamic order by clause in LINQ query in C#
by WyoMetz
Simple and easy paging of a WPF DataGrid with DataTable and LINQ queries
by Jörgen Andersson
A propertymapping extension for DataReaders

All Articles

Sort by Score

Ienumerable 

25 Nov 2011 by Kabwla.Phone
Ha! I get it....I am actually using an adaptation of this technique in production code.But the adapted code required a dept-first search and this original pattern is width-first.Which brings us these new and improved versions:public static List FindControlsWidthFirst( Control...
18 Jan 2012 by Namlak
string blah = string.Join(",", cities.Select(c=> c.Name));
8 Nov 2011 by Kabwla.Phone
Implemented with a queue and some newfangled yields.Since a queue does not have an 'EnqueueRange', we will still have to do a loop. Of course, enqueue range would be a nice extension method.Excusing the overhead created by the yield, this might use less memory if there are many controls. (Or...
18 Jan 2012 by wgross
I would just use:string.Join(",", cities.Select(c=>c.Name))Since Version 4 of the Framework there is an overloaded versions of string.Join for IEnumerable too. It uses a StringBuilder internally and doesn't insert a seperator after the last element as well.I could't find the Join method...
24 Jan 2012 by Mikhail-T
A short one-line way to convert Array or List of any data into custom string via LINQ
5 Jun 2022 by Ramesh Bevara
An overview of a helper class to build dynamic order by clause in LINQ query in C#
24 Jan 2012 by Richard Deeming
If you're stuck with .NET 3.5, you can use the Aggregate extension method[^]:string cities_string = cities.Aggregate(new StringBuilder(), (sb, c) =>{ if (0 != sb.Length) sb.Append(", "); sb.Append(c.Name); return sb;}, sb => sb.ToString());