API Reference

This section provides detailed documentation for all public APIs in Dumpify.

Reference Description
Extension Methods Dump(), DumpConsole(), DumpDebug(), DumpTrace(), DumpText()
DumpConfig Global configuration singleton
DumpColor Color representation for styling

Extension Methods Overview

Dumpify provides five main extension methods that can be called on any object:

// Primary method - outputs to configured default (Console by default)
object.Dump();

// Output-specific methods
object.DumpConsole();  // Always outputs to Console
object.DumpDebug();    // Always outputs to Debug
object.DumpTrace();    // Always outputs to Trace

// Returns string instead of outputting
string text = object.DumpText();

All extension methods share the same parameter signature. See Extension Methods for complete details.

Configuration Classes

Configuration is handled through several specialized classes:

Class Purpose Documentation
DumpConfig Global singleton configuration DumpConfig Reference
ColorConfig Color scheme settings Color Configuration
TableConfig Table rendering options Table Configuration
MembersConfig Member filtering rules Members Configuration
TypeNamingConfig Type name display options Type Naming Configuration
TypeRenderingConfig Custom type rendering Type Rendering Configuration
OutputConfig Output dimensions Output Configuration

Utility Classes

Class Purpose Documentation
DumpColor Color representation DumpColor Reference

Interfaces

Dumpify exposes several interfaces for extensibility:

// Output targets
public interface IDumpOutput
{
    void WriteRenderedObject(IRenderedObject renderedObject, OutputConfig config);
}

// Renderers
public interface IRenderer
{
    IRenderedObject Render<T>(T? obj, IDescriptor? descriptor, RendererConfig config);
}

Static Accessors

Outputs

Access built-in output targets:

Dumpify.Outputs.Console  // Console output (default)
Dumpify.Outputs.Debug    // System.Diagnostics.Debug output
Dumpify.Outputs.Trace    // System.Diagnostics.Trace output

Renderers

Access built-in renderers:

Dumpify.Renderers.Table  // Table renderer (default)

Method Chaining

All Dump methods (except DumpText) return the original object, enabling method chaining:

var result = GetData()
    .Dump("Raw data")
    .Where(x => x.IsActive)
    .Dump("Filtered")
    .OrderBy(x => x.Name)
    .Dump("Sorted")
    .ToList();

Null Safety

All extension methods handle null values gracefully:

string? nullString = null;
nullString.Dump();  // Outputs: null

Methods use [NotNullIfNotNull] attribute to preserve nullability in return types.


See Also


Table of contents