EnumerableDebugger Dump T  Method (IEnumerable T , ConsoleColor)CleanCode C# Libraries v1.2.03 API
Dumps the specified input to the console, colorizing per the specified color.

Namespace: CleanCode.Diagnostics
Assembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
Syntax

public static IEnumerable<T> Dump<T>(
	this IEnumerable<T> input,
	ConsoleColor textColor
)

Parameters

input
Type: OnlineSystem.Collections.Generic IEnumerable T 
The input.
textColor
Type: OnlineSystem ConsoleColor
Color of the text.
Type Parameters

T
The type of the elements of source.

Return Value

Input unchanged.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type OnlineIEnumerable T . When you use instance method syntax to call this method, omit the first parameter. For more information, see OnlineExtension Methods (Visual Basic) or OnlineExtension Methods (C# Programming Guide).
Examples

Assume you have a word list in a string array. This example processes the list with LINQ while dumping every step to the console. Each step is colorized distinctly.
return words
    .Dump(ConsoleColor.Yellow)
    .Select(word => word.Trim())
    .Dump(ConsoleColor.Yellow)
    .Select(word => word.ToLower())
    .Dump(ConsoleColor.Green)
    .Where(word => word.StartsWith("k"))
    .Dump(ConsoleColor.Red)
    .OrderBy(word => word)
    .Dump(ConsoleColor.Blue);
See Also