### Complete Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/type-rendering-config.md A comprehensive example showing how to instantiate and use TypeRenderingConfig. ```APIDOC ## Complete Example This example demonstrates creating a `TypeRenderingConfig` object and applying it to a dump operation. ```csharp var typeRenderingConfig = new TypeRenderingConfig { QuoteStringValues = true, StringQuotationChar = '"', QuoteCharValues = true, CharQuotationChar = '\'' }; obj.Dump(typeRenderingConfig: typeRenderingConfig); ``` ``` -------------------------------- ### Complete Configuration Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/global-configuration.md A comprehensive example demonstrating various global configuration settings. ```APIDOC ## Example: Complete Configuration ### Description An example illustrating how to set multiple global configuration options at once. ### Method N/A (Property Assignment) ### Endpoint N/A ### Parameters N/A ### Request Example ```csharp // Configure Dumpify globally DumpConfig.Default.MaxDepth = 5; DumpConfig.Default.UseAutoLabels = true; // Colors DumpConfig.Default.ColorConfig.TypeNameColor = new DumpColor("#FFD700"); DumpConfig.Default.ColorConfig.PropertyNameColor = new DumpColor("#87CEEB"); // Table DumpConfig.Default.TableConfig.ShowRowSeparators = true; DumpConfig.Default.TableConfig.ShowMemberTypes = true; // Members DumpConfig.Default.MembersConfig.IncludeFields = true; // Type naming DumpConfig.Default.TypeNamingConfig.UseAliases = true; DumpConfig.Default.TypeNamingConfig.ShowTypeNames = true; // Now all dumps use these settings myObject.Dump(); ``` ### Response #### Success Response (200) N/A (Configuration is applied) #### Response Example N/A ``` -------------------------------- ### Complete Table Configuration Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md A comprehensive example showing how to configure all TableConfig properties at once. ```APIDOC ## Complete Table Configuration ```csharp var tableConfig = new TableConfig { ShowArrayIndices = true, ShowTableHeaders = true, ShowRowSeparators = true, ShowMemberTypes = true, ExpandTables = false, NoColumnWrapping = false, BorderStyle = TableBorderStyle.Rounded }; obj.Dump(tableConfig: tableConfig); ``` ``` -------------------------------- ### Installation Source: https://context7.com/moaidhathot/dumpify/llms.txt Instructions on how to install the Dumpify NuGet package and enable its extension methods. ```APIDOC ## Installation Install Dumpify via NuGet package manager. ```bash # .NET CLI dotnet add package Dumpify # Package Manager Console Install-Package Dumpify ``` After installation, add the using directive to enable the extension methods on all objects: ```csharp using Dumpify; ``` ``` -------------------------------- ### Usage Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-output.md Examples demonstrating how to use the DumpOutput class for various output scenarios. ```APIDOC ## Usage Examples ### Simple Output to TextWriter ```csharp // Output to a StringWriter var stringWriter = new StringWriter(); var output = new DumpOutput(stringWriter); myObject.Dump(output: output); string result = stringWriter.ToString(); ``` ### Output to File ```csharp using var fileWriter = new StreamWriter("dump.txt"); var output = new DumpOutput(fileWriter); myObject.Dump(output: output); ``` ### With Config Adjustment ```csharp // Create output that disables colors var output = new DumpOutput( writer: Console.Out, configFactory: config => config with { ColorConfig = ColorConfig.NoColors } ); myObject.Dump(output: output); ``` ### Custom Log Output ```csharp // Output that forces ASCII borders for log compatibility var logOutput = new DumpOutput( writer: logWriter, configFactory: config => config with { ColorConfig = ColorConfig.NoColors, TableConfig = config.TableConfig with { BorderStyle = TableBorderStyle.Ascii } } ); DumpConfig.Default.Output = logOutput; ``` ``` -------------------------------- ### Complete Type Naming Configuration Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/type-naming-config.md A comprehensive example demonstrating the initialization and application of a 'TypeNamingConfig' object with various settings. ```csharp var typeNamingConfig = new TypeNamingConfig { UseAliases = true, // int instead of Int32 UseFullName = false, // List instead of System.Collections.Generic.List ShowTypeNames = true, // Show type names SimplifyAnonymousObjectNames = true, // Clean anonymous type names SeparateTypesWithSpace = true // Dictionary }; obj.Dump(typeNames: typeNamingConfig); ``` -------------------------------- ### Complete TypeRenderingConfig Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/type-rendering-config.md An example demonstrating the creation and application of a TypeRenderingConfig object with all properties set. ```csharp var typeRenderingConfig = new TypeRenderingConfig { QuoteStringValues = true, StringQuotationChar = '"', QuoteCharValues = true, CharQuotationChar = '\'' }; obj.Dump(typeRenderingConfig: typeRenderingConfig); ``` -------------------------------- ### Dump() Usage Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-extensions.md Basic usage examples for the Dump method with labels and configuration options. ```csharp // Simple dump myObject.Dump(); // With label myObject.Dump("My Object"); // With options myObject.Dump(label: "Data", maxDepth: 3); ``` -------------------------------- ### String Quotation Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/type-rendering-config.md Examples demonstrating how to control string quotation behavior. ```APIDOC ## String Quotation Examples ### Default String Quotation By default, strings are wrapped in double quotes. ```csharp new { Name = "John" }.Dump(); // Output: Name = "John" ``` ### Disable String Quotation To disable string quotation, set `QuoteStringValues` to `false`. ```csharp new { Name = "John" }.Dump(typeRenderingConfig: new TypeRenderingConfig { QuoteStringValues = false }); // Output: Name = John ``` ### Custom String Quote Character To use a custom character for quoting strings, modify `StringQuotationChar`. ```csharp new { Name = "John" }.Dump(typeRenderingConfig: new TypeRenderingConfig { StringQuotationChar = '\'' }); // Output: Name = 'John' ``` ``` -------------------------------- ### DumpConsole() Usage Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-extensions.md Examples demonstrating how DumpConsole ignores global output configurations. ```csharp // Always goes to Console.WriteLine myObject.DumpConsole(); // Even if global output is set to Debug DumpConfig.Default.Output = Outputs.Debug; myObject.DumpConsole(); // Still outputs to console ``` -------------------------------- ### Char Quotation Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/type-rendering-config.md Examples demonstrating how to control character quotation behavior. ```APIDOC ## Char Quotation Examples ### Default Char Quotation By default, characters are wrapped in single quotes. ```csharp new { Letter = 'A' }.Dump(); // Output: Letter = 'A' ``` ### Disable Char Quotation To disable character quotation, set `QuoteCharValues` to `false`. ```csharp new { Letter = 'A' }.Dump(typeRenderingConfig: new TypeRenderingConfig { QuoteCharValues = false }); // Output: Letter = A ``` ### Custom Char Quote Character To use a custom character for quoting characters, modify `CharQuotationChar`. ```csharp new { Letter = 'A' }.Dump(typeRenderingConfig: new TypeRenderingConfig { CharQuotationChar = '`' }); // Output: Letter = `A` ``` ``` -------------------------------- ### Install Dumpify NuGet Package Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/index.md Install the Dumpify NuGet package using the .NET CLI. ```bash dotnet add package Dumpify ``` -------------------------------- ### Install Dumpify via NuGet Source: https://github.com/moaidhathot/dumpify/blob/main/docs/getting-started.md Install the Dumpify package using the .NET CLI or Package Manager Console. ```bash # .NET CLI dotnet add package Dumpify # Package Manager Console Install-Package Dumpify ``` -------------------------------- ### Complete Example with OutputConfig Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/output-config.md Demonstrates creating an OutputConfig object with specific width and height overrides and passing it to the Dump method. ```csharp var outputConfig = new OutputConfig { WidthOverride = 120, HeightOverride = null // Use console height }; obj.Dump(outputConfig: outputConfig); ``` -------------------------------- ### Complete Table Configuration Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Demonstrates setting all available TableConfig properties to specific values for a single dump operation. ```csharp var tableConfig = new TableConfig { ShowArrayIndices = true, ShowTableHeaders = true, ShowRowSeparators = true, ShowMemberTypes = true, ExpandTables = false, NoColumnWrapping = false, BorderStyle = TableBorderStyle.Rounded }; obj.Dump(tableConfig: tableConfig); ``` -------------------------------- ### Install Dumpify via Package Manager Console Source: https://github.com/moaidhathot/dumpify/blob/main/docs/index.md Use the Package Manager Console in Visual Studio to install the Dumpify package. ```powershell Install-Package Dumpify ``` -------------------------------- ### DumpTrace() Usage Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-extensions.md Example of using DumpTrace to send output to configured trace listeners. ```csharp // Output goes to configured trace listeners myObject.DumpTrace(); ``` -------------------------------- ### Configuring TableBorderStyle Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/table-border-style.md Examples of how to apply TableBorderStyle globally or per-call. ```APIDOC ## Configuring TableBorderStyle ### Setting Global Default ```csharp DumpConfig.Default.TableConfig.BorderStyle = TableBorderStyle.Rounded; ``` ### Per-Call Override ```csharp var tableConfig = new TableConfig { BorderStyle = TableBorderStyle.Ascii }; myObject.Dump(tableConfig: tableConfig); ``` ``` -------------------------------- ### Expanding Tables Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example of how to make tables expand to fill the available width. ```APIDOC ## Expand Tables Make tables expand to fill available width: ```csharp obj.Dump(tableConfig: new TableConfig { ExpandTables = true }); ``` ``` -------------------------------- ### Configuring Multiple Colors Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-color.md Example of setting up a custom theme by assigning multiple hex strings to ColorConfig. ```csharp // Set up a dark theme var colorConfig = DumpConfig.Default.ColorConfig; colorConfig.NullValueColor = "#6B7280"; // Gray for null colorConfig.PropertyValueColor = "#10B981"; // Green for property values colorConfig.PropertyNameColor = "#3B82F6"; // Blue for property names colorConfig.TypeNameColor = "#E5C07B"; // Yellow for type names colorConfig.ColumnNameColor = "#61AFEF"; // Blue for column headers colorConfig.MetadataInfoColor = "#8B5CF6"; // Purple for metadata colorConfig.LabelValueColor = "#D7AFD7"; // Pink for labels ``` -------------------------------- ### Use Case: Compact Output Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example configuration for compact output by disabling extra information. ```APIDOC ## Compact Output For minimal output, disable extra information: ```csharp obj.Dump(tableConfig: new TableConfig { ShowTableHeaders = false, ShowArrayIndices = false, ShowMemberTypes = false }); ``` ``` -------------------------------- ### Global Table Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example of setting table configuration globally for all dumps. ```APIDOC ## Global Table Configuration ```csharp // Set globally DumpConfig.Default.TableConfig.ShowRowSeparators = true; DumpConfig.Default.TableConfig.ShowMemberTypes = true; // All dumps now use these settings myObject.Dump(); ``` ``` -------------------------------- ### Configuring TruncationMode Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/truncation-mode.md Examples of how to apply TruncationMode globally or as a per-call override. ```APIDOC ## Configuring TruncationMode ### Global Configuration ```csharp DumpConfig.Default.TruncationConfig.Mode = TruncationMode.HeadAndTail; DumpConfig.Default.TruncationConfig.MaxCollectionCount = 10; ``` ### Per-Call Override ```csharp var truncationConfig = new TruncationConfig { Mode = TruncationMode.Tail, MaxCollectionCount = 5 }; myLargeList.Dump(truncationConfig: truncationConfig); ``` ``` -------------------------------- ### MemberFilterContext Usage Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/member-filter-context.md Examples demonstrating how to use MemberFilterContext for various filtering scenarios. ```APIDOC ## MemberFilterContext Usage Examples ### Basic Filtering ```csharp // Exclude null values DumpConfig.Default.MembersConfig.MemberFilter = ctx => ctx.Value is not null; // Exclude specific property names DumpConfig.Default.MembersConfig.MemberFilter = ctx => ctx.Member.Name != "Password" && ctx.Member.Name != "Secret"; ``` ### Filtering by Depth ```csharp // Only show top-level properties DumpConfig.Default.MembersConfig.MemberFilter = ctx => ctx.Depth == 0; // Show details only for first 2 levels DumpConfig.Default.MembersConfig.MemberFilter = ctx => ctx.Depth < 2; ``` ### Filtering by Type ```csharp // Exclude byte arrays (e.g., large binary data) DumpConfig.Default.MembersConfig.MemberFilter = ctx => ctx.Member.MemberType != typeof(byte[]); // Only show string and numeric properties DumpConfig.Default.MembersConfig.MemberFilter = ctx => { var type = ctx.Member.MemberType; return type == typeof(string) || type.IsPrimitive || type == typeof(decimal); }; ``` ### Per-Call Filtering ```csharp myObject.Dump(memberFilter: ctx => ctx.Value is not null); ``` ### Hide Sensitive Data ```csharp var sensitiveNames = new HashSet { "Password", "Secret", "ApiKey", "Token", "ConnectionString" }; DumpConfig.Default.MembersConfig.MemberFilter = ctx => !sensitiveNames.Contains(ctx.Member.Name); ``` ### Show Only Changed Values ```csharp // Assuming you have a way to determine default values DumpConfig.Default.MembersConfig.MemberFilter = ctx => { var value = ctx.Value; if (value is null) return false; if (value is string s && string.IsNullOrEmpty(s)) return false; if (value is 0 or 0L or 0.0 or 0.0f) return false; return true; }; ``` ### Depth-Based Detail Levels ```csharp DumpConfig.Default.MembersConfig.MemberFilter = ctx => { // Always show top level if (ctx.Depth == 0) return true; // At deeper levels, hide collections and complex objects if (ctx.Depth > 1 && ctx.Value is IEnumerable && ctx.Value is not string) return false; return true; }; ``` ``` -------------------------------- ### Per-Dump Configuration Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/index.md Pass configuration options directly to the .Dump() method for specific object dumps. This allows for fine-grained control over individual dump outputs. ```csharp obj.Dump( label: "My Object", maxDepth: 3, colors: new ColorConfig { PropertyValueColor = new DumpColor("#FF5733") }, tableConfig: new TableConfig { ShowRowSeparators = true } ); ``` -------------------------------- ### Color Configuration Usage Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-color.md Examples of how to apply DumpColor instances to the DumpConfig.Default.ColorConfig object. ```APIDOC ## Configuring Colors ### Description Apply color settings to the global Dumpify configuration or per-call overrides. ### Usage Examples ```csharp // Using implicit conversion from string DumpConfig.Default.ColorConfig.NullValueColor = "#FF6B6B"; // Using System.Drawing.Color DumpConfig.Default.ColorConfig.MetadataInfoColor = Color.Green; // Per-Call Override var customColors = new ColorConfig { NullValueColor = "#FF0000" }; myObject.Dump(colors: customColors); ``` ``` -------------------------------- ### DumpText() Usage Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-extensions.md Examples of using DumpText to retrieve formatted strings for logging or file storage. ```csharp // Get formatted string string output = myObject.DumpText(); // Use in logging logger.Info(myObject.DumpText()); // Write to file File.WriteAllText("dump.txt", myObject.DumpText()); ``` -------------------------------- ### Collection Truncation Examples with Dumpify Source: https://github.com/moaidhathot/dumpify/blob/main/docs/features/collections.md Demonstrates various ways to use TruncationConfig for collection output, including showing the first N items, the last N items, or a combination of head and tail. ```csharp var largeArray = Enumerable.Range(1, 1000).ToArray(); // Show first 10 items largeArray.Dump(truncationConfig: new TruncationConfig { MaxCollectionCount = 10 }); // Output: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, [... 990 more] ``` ```csharp // Show last 10 items largeArray.Dump(truncationConfig: new TruncationConfig { MaxCollectionCount = 10, Mode = TruncationMode.Tail }); // Output: [... 990 more], 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000 ``` ```csharp // Show head and tail largeArray.Dump(truncationConfig: new TruncationConfig { MaxCollectionCount = 10, Mode = TruncationMode.HeadAndTail }); // Output: 1, 2, 3, 4, 5, [... 990 more], 996, 997, 998, 999, 1000 ``` -------------------------------- ### DumpDebug() Usage Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-extensions.md Example of using DumpDebug to send output to the IDE debug window. ```csharp // Output appears in Debug window (Visual Studio, Rider, etc.) myObject.DumpDebug(); ``` -------------------------------- ### Complete Member Filtering Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/members-config.md A comprehensive example demonstrating multiple filtering conditions, including excluding password fields, null values, and limiting properties at deeper nesting levels. ```csharp var membersConfig = new MembersConfig { IncludePublicMembers = true, IncludeNonPublicMembers = true, IncludeVirtualMembers = true, IncludeProperties = true, IncludeFields = true, MemberFilter = ctx => { // Exclude password fields if (ctx.Member.Info.Name.Contains("Password")) return false; // Exclude null values if (ctx.Value is null) return false; // At nested levels, only show essential properties if (ctx.Depth > 1) return ctx.Member.Name is "Id" or "Name" or "Title"; return true; } }; sensitiveObject.Dump(members: membersConfig); ``` -------------------------------- ### Use Cases Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/type-rendering-config.md Examples of using TypeRenderingConfig for specific output formats like JSON-like or plain text. ```APIDOC ## Use Cases ### JSON-like Output To achieve output that resembles JSON, configure string quotation. ```csharp DumpConfig.Default.TypeRenderingConfig.QuoteStringValues = true; DumpConfig.Default.TypeRenderingConfig.StringQuotationChar = '"'; ``` ### Plain Text Output For output without any quotation marks, disable both string and character quotation. ```csharp obj.Dump(typeRenderingConfig: new TypeRenderingConfig { QuoteStringValues = false, QuoteCharValues = false }); ``` ``` -------------------------------- ### Configure TruncationMode Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/truncation-mode.md Examples for setting the truncation mode globally or overriding it for a specific dump call. ```csharp DumpConfig.Default.TruncationConfig.Mode = TruncationMode.HeadAndTail; DumpConfig.Default.TruncationConfig.MaxCollectionCount = 10; ``` ```csharp var truncationConfig = new TruncationConfig { Mode = TruncationMode.Tail, MaxCollectionCount = 5 }; myLargeList.Dump(truncationConfig: truncationConfig); ``` -------------------------------- ### Thread Safety Example Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-config.md Demonstrates safe and potentially unsafe configuration modifications in a multi-threaded environment. Configuring at startup is safe, while modifying during concurrent dumps can lead to race conditions. ```csharp // Safe: configure at startup before other threads access DumpConfig.Default.MaxDepth = 5; // Potentially unsafe: modifying during concurrent Dump() calls Task.Run(() => DumpConfig.Default.MaxDepth = 10); // Race condition ``` -------------------------------- ### Visual Output Examples Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/truncation-mode.md Representations of how different truncation modes appear in the output. ```text [0] Item 0 [1] Item 1 [2] Item 2 [3] Item 3 [4] Item 4 [5] Item 5 ... and 94 more ``` ```text 94 more items ... [94] Item 94 [95] Item 95 [96] Item 96 [97] Item 97 [98] Item 98 [99] Item 99 ``` ```text [0] Item 0 [1] Item 1 [2] Item 2 ... 94 more items ... [97] Item 97 [98] Item 98 [99] Item 99 ``` -------------------------------- ### Quick Example: Dump Anonymous Type Source: https://github.com/moaidhathot/dumpify/blob/main/docs/index.md Demonstrates how to use the .Dump() extension method on an anonymous type to display its properties in a structured and colorful format in the console. ```csharp using Dumpify; // Dump any object to the console new { Name = "Dumpify", Description = "Dump any object to Console" }.Dump(); ``` -------------------------------- ### Use Case: Detailed Object Inspection Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example configuration for detailed object inspection by enabling all display options. ```APIDOC ## Detailed Object Inspection For detailed inspection, enable all display options: ```csharp obj.Dump(tableConfig: new TableConfig { ShowRowSeparators = true, ShowMemberTypes = true, ShowTableHeaders = true, ShowArrayIndices = true }); ``` ``` -------------------------------- ### Visual Example: None Table Border Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/table-border-style.md Shows a table rendered with the `None` border style, resulting in output without any borders. ```text Name Value FirstName John LastName Doe ``` -------------------------------- ### Showing Member Types Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example of how to display a column showing the type of each member in a table. ```APIDOC ## Show Member Types Display a column showing the type of each member: ```csharp obj.Dump(tableConfig: new TableConfig { ShowMemberTypes = true }); ``` ``` -------------------------------- ### Modifying Global Properties Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/global-configuration.md Examples of how to modify individual global configuration properties. ```APIDOC ## Modifying Global Properties ### Description Modify properties of the `DumpConfig.Default` object to customize dump behavior. ### Method N/A (Property Assignment) ### Endpoint N/A ### Parameters N/A ### Request Example ```csharp // Limit nesting to 3 levels DumpConfig.Default.MaxDepth = 3; // Enable descriptor-based analysis DumpConfig.Default.UseDescriptors = true; // Disable table headers DumpConfig.Default.ShowHeaders = false; // Enable automatic labels DumpConfig.Default.UseAutoLabels = true; ``` ### Response #### Success Response (200) N/A (Configuration is modified in place) #### Response Example N/A ``` -------------------------------- ### Supported Hex String Formats Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-color.md Examples of valid hex string formats and named colors accepted by Dumpify. ```csharp // With hash prefix (recommended) "#FF5733" "#ff5733" // Case insensitive // Named colors (supported by System.Drawing) "Red" "Blue" "Green" ``` -------------------------------- ### Modifying Advanced Properties Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/global-configuration.md Examples for configuring advanced properties like Generator, Renderer, and Output. ```APIDOC ## Modifying Advanced Properties ### Description Configure advanced properties that control the underlying generation, rendering, and output mechanisms. ### Method N/A (Property Assignment) ### Endpoint N/A ### Parameters N/A ### Request Example ```csharp // Change default output to Debug DumpConfig.Default.Output = Outputs.Debug; ``` ### Response #### Success Response (200) N/A (Configuration is modified in place) #### Response Example N/A ``` -------------------------------- ### Get Default Colors Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/color-config.md Retrieves the default color scheme used by Dumpify. This is useful as a starting point for custom configurations. ```csharp var defaultColors = ColorConfig.DefaultColors; ``` -------------------------------- ### GUID Shortened Handler Source: https://github.com/moaidhathot/dumpify/blob/main/docs/features/custom-type-handlers.md Format GUIDs to display only the first 8 characters followed by '...' for brevity. This handler truncates the standard GUID string representation. ```csharp DumpConfig.Default.AddCustomTypeHandler( typeof(Guid), (obj, type, vp, mp) => ((Guid)obj).ToString("N").Substring(0, 8) + "..." ); ``` -------------------------------- ### Custom Dumpify Logger Implementation Source: https://github.com/moaidhathot/dumpify/blob/main/docs/features/output-targets.md Implement the IDumpOutput interface to integrate Dumpify with a custom logging framework. This example shows how to log rendered objects using ILogger. ```csharp public class DumpifyLogger : IDumpOutput { private readonly ILogger _logger; public DumpifyLogger(ILogger logger) { _logger = logger; } public void WriteRenderedObject(IRenderedObject renderedObject, OutputConfig config) { // Convert to string and log using var writer = new StringWriter(); renderedObject.Output(new DumpOutput(writer), config); _logger.LogDebug(writer.ToString()); } } ``` -------------------------------- ### Visual Example: Markdown Table Border Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/table-border-style.md Presents a table formatted according to the `Markdown` style, suitable for embedding in Markdown documents. ```text | Name | Value | |-----------|---------| | FirstName | John | | LastName | Doe | ``` -------------------------------- ### Creating DumpColor Instances Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-color.md Demonstrates instantiation via constructors, factory methods, and implicit conversion from hex strings. ```csharp // Using constructor var color1 = new DumpColor("#FF5733"); // Using factory method var color2 = DumpColor.FromHexString("#FF5733"); // Using implicit conversion (most common) DumpColor color3 = "#FF5733"; ``` -------------------------------- ### Combine Type Naming and Table Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/type-naming-config.md Example of combining 'TypeNamingConfig' to hide type names with 'TableConfig' to hide table headers for minimal output. ```csharp obj.Dump( typeNames: new TypeNamingConfig { ShowTypeNames = false }, tableConfig: new TableConfig { ShowTableHeaders = false } ); ``` -------------------------------- ### Dump Primitive Types in C# Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/basic-usage.md Demonstrates how to dump various primitive data types like strings, numbers, booleans, characters, DateTime, and Guids using Dumpify. Ensure the Dumpify library is imported. ```csharp using Dumpify; // Strings "Hello, World!".Dump(); // Numbers 42.Dump(); 3.14159.Dump(); decimal.MaxValue.Dump(); // Booleans true.Dump(); // Characters 'A'.Dump(); // DateTime DateTime.Now.Dump(); DateOnly.FromDateTime(DateTime.Now).Dump(); TimeOnly.FromDateTime(DateTime.Now).Dump(); // Guid Guid.NewGuid().Dump(); ``` -------------------------------- ### Basic Dump Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-config.md Sets up basic dump configurations at application startup, including maximum depth, auto labels, null value color, and table header visibility. ```csharp // Configure at application startup DumpConfig.Default.MaxDepth = 5; DumpConfig.Default.UseAutoLabels = true; DumpConfig.Default.ColorConfig.NullValueColor = "#FF6B6B"; DumpConfig.Default.TableConfig.ShowTableHeaders = false; ``` -------------------------------- ### Define and Dump a Simple Class in C# Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/basic-usage.md Illustrates how to define a simple C# class with properties and then dump an instance of that class using Dumpify. The output will be a formatted table of properties and their values. ```csharp public class Person { public string Name { get; set; } public int Age { get; set; } public string Email { get; set; } } var person = new Person { Name = "Alice", Age = 28, Email = "alice@example.com" }; person.Dump(); ``` -------------------------------- ### Accessing Global Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/global-configuration.md Demonstrates how to access the default global configuration object. ```APIDOC ## Accessing Global Configuration ### Description Access the global configuration settings that apply to all dumps unless overridden. ### Method N/A (Property Access) ### Endpoint N/A ### Parameters N/A ### Request Example ```csharp using Dumpify; var config = DumpConfig.Default; ``` ### Response #### Success Response (200) - **config** (DumpConfig) - The global configuration object. #### Response Example ```csharp // config object representing global settings ``` ``` -------------------------------- ### Hiding Table Headers Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example of how to hide table headers. ```APIDOC ## Hide Table Headers ```csharp obj.Dump(tableConfig: new TableConfig { ShowTableHeaders = false }); ``` ``` -------------------------------- ### Dump Application Configuration at Startup Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/real-world-scenarios.md In DEBUG builds, this code snippet dumps the application's configuration, excluding sensitive password information, during startup. Ensure the 'Dump' extension method is available. ```csharp var builder = WebApplication.CreateBuilder(args); // Dump configuration during startup #if DEBUG builder.Configuration.AsEnumerable() .Where(kvp => !kvp.Key.Contains("Password", StringComparison.OrdinalIgnoreCase)) .ToDictionary(kvp => kvp.Key, kvp => kvp.Value) .Dump("Application Configuration"); #endif var app = builder.Build(); ``` -------------------------------- ### Hiding Array Indices Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example of how to hide array indices in table output. ```APIDOC ## Hide Array Indices ```csharp var arr = new[] { "a", "b", "c" }; arr.Dump(tableConfig: new TableConfig { ShowArrayIndices = false }); ``` ``` -------------------------------- ### Inspect Options Pattern Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/real-world-scenarios.md This snippet configures and injects options using the Options pattern. It registers 'MyOptions' with dependency injection and dumps the loaded options value. Ensure 'MyOptions' class and configuration section are defined. ```csharp services.Configure(configuration.GetSection("MyOptions")); services.AddSingleton(sp => { var options = sp.GetRequiredService>().Value; options.Dump("Loaded MyOptions"); return options; }); ``` -------------------------------- ### Configure TruncationConfig Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/truncation-mode.md Example of using TruncationMode within a broader TruncationConfig object. ```csharp var config = new TruncationConfig { MaxCollectionCount = 10, // Maximum items to show Mode = TruncationMode.HeadAndTail, PerDimension = true // Apply truncation per dimension in multi-dimensional arrays }; ``` -------------------------------- ### Preventing Column Wrapping Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example of how to prevent text wrapping within table columns. ```APIDOC ## Prevent Column Wrapping Keep text on single lines (may cause horizontal scrolling): ```csharp obj.Dump(tableConfig: new TableConfig { NoColumnWrapping = true }); ``` ``` -------------------------------- ### Configure Global Dumpify Defaults Source: https://context7.com/moaidhathot/dumpify/llms.txt Set global configuration options at application startup to ensure consistent defaults for all Dumpify operations. This includes limiting nesting depth, enabling auto labels, using descriptors, showing headers, and setting the default output target. ```csharp using Dumpify; // Configure global defaults at application startup DumpConfig.Default.MaxDepth = 5; // Limit nesting to 5 levels DumpConfig.Default.UseAutoLabels = true; // Use variable names as labels DumpConfig.Default.UseDescriptors = true; // Use reflection (vs ToString()) DumpConfig.Default.ShowHeaders = true; // Show table headers // Change default output target DumpConfig.Default.Output = Outputs.Debug; // All Dump() calls go to Debug // Access configuration objects DumpConfig.Default.ColorConfig.NullValueColor = "#FF6B6B"; DumpConfig.Default.TableConfig.ShowRowSeparators = true; DumpConfig.Default.MembersConfig.IncludeFields = true; // Now these settings apply to all dumps myObject.Dump(); // Uses global settings myObject.DumpConsole(); // Explicit console output ignores Output setting ``` -------------------------------- ### Enabling Row Separators Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example of how to enable row separators for improved table readability. ```APIDOC ## Show Row Separators Add horizontal lines between rows for better readability: ```csharp obj.Dump(tableConfig: new TableConfig { ShowRowSeparators = true }); ``` ``` -------------------------------- ### Filter Members by Name and Value Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/member-filter-context.md Examples of basic filtering logic for properties and values. ```csharp // Exclude null values DumpConfig.Default.MembersConfig.MemberFilter = ctx => ctx.Value is not null; // Exclude specific property names DumpConfig.Default.MembersConfig.MemberFilter = ctx => ctx.Member.Name != "Password" && ctx.Member.Name != "Secret"; ``` -------------------------------- ### Dump Queue and Stack in C# Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/basic-usage.md Shows how to dump a Queue and a Stack data structure. Dumpify visualizes the elements in the order they are stored or retrieved. ```csharp var queue = new Queue(); queue.Enqueue("First"); queue.Enqueue("Second"); queue.Enqueue("Third"); queue.Dump("Queue"); var stack = new Stack(); stack.Push(1); stack.Push(2); stack.Push(3); stack.Dump("Stack"); ``` -------------------------------- ### Creating DumpColor from System.Drawing.Color Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-color.md Demonstrates instantiation using System.Drawing.Color objects. ```csharp using System.Drawing; // Using constructor var color1 = new DumpColor(Color.Red); // Using implicit conversion DumpColor color2 = Color.Blue; ``` -------------------------------- ### When to Use DumpOutput vs IDumpOutput Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-output.md Guidance on choosing between DumpOutput and implementing IDumpOutput directly. ```APIDOC ## When to Use DumpOutput vs IDumpOutput | Scenario | Recommendation | |----------|----------------| | Simple output to any `TextWriter` | Use `DumpOutput` | | Need config adjustments | Use `DumpOutput` with `configFactory` | | Complex custom behavior | Implement `IDumpOutput` directly | | Built-in targets (Console, Debug, Trace) | Use `Dumpify.Outputs.*` | ``` -------------------------------- ### Built-in Implementations Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/idump-output.md Dumpify provides several pre-configured output targets through the static `Outputs` class. ```APIDOC ## Built-in Implementations Dumpify provides several pre-configured outputs via the `Outputs` static class: ```csharp // Console output (default) Dumpify.Outputs.Console // Debug output (System.Diagnostics.Debug) Dumpify.Outputs.Debug // Trace output (System.Diagnostics.Trace) Dumpify.Outputs.Trace ``` ``` -------------------------------- ### File Output Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/output-config.md Set a global output width override before dumping to a file, as console width is not relevant for file output. ```csharp DumpConfig.Default.OutputConfig.WidthOverride = 120; var text = obj.DumpText(); File.WriteAllText("dump.txt", text); ``` -------------------------------- ### Changing Table Border Style Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Examples of how to change the table border style to resolve terminal display issues. ```APIDOC ## Change Border Style Fix terminal rendering issues by changing the border style: ```csharp // For terminals with Unicode issues (VS Code, some Windows Terminal fonts) // Use ASCII for maximum compatibility obj.Dump(tableConfig: new TableConfig { BorderStyle = TableBorderStyle.Ascii }); // Use Square instead of Rounded if only corners are broken obj.Dump(tableConfig: new TableConfig { BorderStyle = TableBorderStyle.Square }); ``` Set globally to fix all dumps: ```csharp // Fix for entire application DumpConfig.Default.TableConfig.BorderStyle = TableBorderStyle.Ascii; // All dumps now use ASCII borders myObject.Dump(); ``` ``` -------------------------------- ### Combined Row Separators and Member Types Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/table-config.md Example demonstrating how to enable both row separators and member type display simultaneously. ```APIDOC ## Combined: Row Separators and Member Types ```csharp obj.Dump(tableConfig: new TableConfig { ShowRowSeparators = true, ShowMemberTypes = true }); ``` ![Row separators and member types](https://raw.githubusercontent.com/MoaidHathot/Dumpify/main/assets/screenshots/row-separator.png) ``` -------------------------------- ### Implementing Custom Outputs Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/idump-output.md You can create custom output targets by implementing the `IDumpOutput` interface. ```APIDOC ## Implementing Custom Outputs You can create custom output targets by implementing `IDumpOutput`: ```csharp public class FileOutput : IDumpOutput { private readonly StreamWriter _writer; public TextWriter TextWriter => _writer; public FileOutput(string filePath) { _writer = new StreamWriter(filePath, append: true); } public RendererConfig AdjustConfig(in RendererConfig config) { // Optionally modify the config for file output // For example, disable colors for plain text files return config with { ColorConfig = ColorConfig.NoColors }; } } ``` ### Using Custom Output ```csharp // Set as global default DumpConfig.Default.Output = new FileOutput("dump.log"); // Or use per-call myObject.Dump(output: new FileOutput("dump.log")); ``` ``` -------------------------------- ### Inline Configuration for Single Dump Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/advanced-usage.md Pass configuration parameters directly to customize a single dump. Useful for one-off customizations without affecting global settings. ```csharp var data = GetComplexData(); data.Dump( maxDepth: 2, tableConfig: new TableConfig { ShowTableHeaders = false }, colors: new ColorConfig { PropertyValueColor = "#00FFFF" } ); ``` -------------------------------- ### Custom Output Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/features/output-targets.md How to set custom output targets, including changing the default output and implementing custom `IDumpOutput`. ```APIDOC ## Custom Output ### Setting the Default Output ```csharp // Change default output to Debug DumpConfig.Default.Output = Dumpify.Outputs.Debug; // Now Dump() goes to Debug myObject.Dump(); // Goes to Debug myObject.DumpConsole(); // Still goes to Console ``` ### Custom IDumpOutput Implementation Create your own output target by implementing `IDumpOutput`: ```csharp public class FileOutput : IDumpOutput { private readonly string _path; public FileOutput(string path) { _path = path; } public void WriteRenderedObject(IRenderedObject renderedObject, OutputConfig config) { using var writer = new StreamWriter(_path, append: true); // Write to file } } // Use custom output DumpConfig.Default.Output = new FileOutput("dumps.log"); ``` ### Per-Call Custom Output ```csharp // Use custom output for specific call myObject.Dump(output: new FileOutput("special.log")); ``` ``` -------------------------------- ### Implement Custom JSON Renderer Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/irenderer.md Example of a custom IRenderer implementation that serializes objects to JSON with indentation. It returns a StringRenderedObject. ```csharp public class JsonRenderer : IRenderer { public IRenderedObject Render(object? obj, IDescriptor? descriptor, RendererConfig config) { var json = JsonSerializer.Serialize(obj, new JsonSerializerOptions { WriteIndented = true }); return new StringRenderedObject(json); } } ``` -------------------------------- ### Labeling Method Inputs and Outputs Source: https://github.com/moaidhathot/dumpify/blob/main/docs/features/labels.md Use labels to document the input parameters and return values of methods, making it easier to understand data flow. ```csharp public Result ProcessOrder(Order order) { order.Dump("Input Order"); var result = DoProcessing(order); result.Dump("Processing Result"); return result; } ``` -------------------------------- ### Include Public Properties Source: https://github.com/moaidhathot/dumpify/blob/main/docs/features/member-filtering.md By default, public properties are included when dumping objects. This example shows a class with public properties and how to dump it. ```csharp public class Person { public string Name { get; set; } // Included public int Age { get; set; } // Included private string Secret { get; set; } // Excluded } new Person { Name = "John", Age = 30 }.Dump(); ``` -------------------------------- ### Complete Truncation Configuration Object Source: https://github.com/moaidhathot/dumpify/blob/main/docs/configuration/truncation-config.md Demonstrates creating and applying a `TruncationConfig` object with specific settings for `MaxCollectionCount`, `Mode`, and `PerDimension`. This allows for fine-grained control over how a specific collection is displayed. ```csharp var truncationConfig = new TruncationConfig { MaxCollectionCount = 20, Mode = TruncationMode.HeadAndTail, PerDimension = true }; largeCollection.Dump(truncationConfig: truncationConfig); ``` -------------------------------- ### Using System.Drawing.Color Constants Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-color.md Configuring colors using built-in System.Drawing.Color constants. ```csharp using System.Drawing; var colorConfig = DumpConfig.Default.ColorConfig; colorConfig.NullValueColor = Color.Gray; colorConfig.PropertyValueColor = Color.ForestGreen; colorConfig.TypeNameColor = Color.DarkGoldenrod; colorConfig.MetadataInfoColor = Color.Green; colorConfig.MetadataErrorColor = Color.Red; ``` -------------------------------- ### Get Formatted String Output with DumpText() Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-extensions.md The DumpText() method returns the formatted output as a string, which cannot be chained in the same way as other Dumpify methods. -------------------------------- ### Implement Custom Output Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/idump-output.md Create a custom output target by implementing the IDumpOutput interface. ```csharp public class FileOutput : IDumpOutput { private readonly StreamWriter _writer; public TextWriter TextWriter => _writer; public FileOutput(string filePath) { _writer = new StreamWriter(filePath, append: true); } public RendererConfig AdjustConfig(in RendererConfig config) { // Optionally modify the config for file output // For example, disable colors for plain text files return config with { ColorConfig = ColorConfig.NoColors }; } } ``` -------------------------------- ### Register Basic Custom Type Handler Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/advanced-usage.md Control how specific types are rendered by registering a custom handler. This example handles SecureString by outputting '****'. ```csharp // Register a handler for SecureString DumpConfig.Default.AddCustomTypeHandler( typeof(SecureString), (obj, type, valueProvider, memberProvider) => "****" ); var secure = new SecureString(); // Adds characters... secure.Dump(); // Outputs: **** ``` -------------------------------- ### Dump to Multiple Output Targets Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/index.md Demonstrates dumping data to the console, Visual Studio's debug output, and as a string. ```csharp // Console output result.DumpConsole(); // Debug output (Visual Studio Output window) result.DumpDebug(); // Get as string var text = result.DumpText(); ``` -------------------------------- ### Change Default Dump Output Target Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/advanced-usage.md Set the default output target for all `Dump()` calls globally. This example sets the default output to Debug. ```csharp // All Dump() calls will go to Debug by default DumpConfig.Default.Output = Dumpify.Outputs.Debug; data.Dump(); // Goes to Debug data.DumpConsole(); // Explicitly goes to Console ``` -------------------------------- ### Apply Complete Dump Configuration Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/advanced-usage.md Configure Dumpify globally by setting various options for depth, colors, tables, members, and type naming. All subsequent `Dump()` calls will use these settings. ```csharp // Configure globally DumpConfig.Default.MaxDepth = 3; DumpConfig.Default.ColorConfig.LabelValueColor = "#FFD700"; DumpConfig.Default.ColorConfig.TypeNameColor = "#00CED1"; DumpConfig.Default.ColorConfig.PropertyNameColor = "#90EE90"; DumpConfig.Default.ColorConfig.PropertyValueColor = "#FFFFFF"; DumpConfig.Default.ColorConfig.NullValueColor = "#808080"; DumpConfig.Default.ColorConfig.MetadataInfoColor = "#666666"; DumpConfig.Default.TableConfig.ShowTableHeaders = true; DumpConfig.Default.TableConfig.ExpandTables = true; DumpConfig.Default.TableConfig.ShowMemberTypes = false; DumpConfig.Default.MembersConfig.IncludeFields = false; DumpConfig.Default.MembersConfig.IncludePublicMembers = true; DumpConfig.Default.MembersConfig.IncludeNonPublicMembers = false; DumpConfig.Default.TypeNamingConfig.ShowTypeNames = true; DumpConfig.Default.TypeNamingConfig.UseAliases = true; DumpConfig.Default.TypeNamingConfig.UseFullName = false; // All dumps now use these settings data.Dump("Full Config Example"); ``` -------------------------------- ### Utilize Multiple Output Options Source: https://github.com/moaidhathot/dumpify/blob/main/README.md Dump objects to the Console, Debug, Trace, or capture the output as text. Custom outputs can be provided using a TextWriter. ```csharp var package = new { Name = "Dumpify", Description = "Dump any object to Console" }; package.Dump(); //Similar to `package.DumpConsole()` and `package.Dump(output: Outputs.Console)) package.DumpDebug(); //Dump to Visual Studio's Debug source package.DumpTrace(); //Dump to Trace var text = package.DumpText(); //The table in a text format using var writer = new StringWriter(); package.Dump(output: new DumpOutput(writer)); //Custom output ``` -------------------------------- ### Configure Table Appearance Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/dump-extensions.md Customize the visual aspects of table output using the 'tableConfig' parameter and a 'TableConfig' object, for example, to hide table headers. ```csharp var tableConfig = new TableConfig { ShowTableHeaders = false }; myObject.Dump(tableConfig: tableConfig); ``` -------------------------------- ### Visual Example: Rounded Table Border Source: https://github.com/moaidhathot/dumpify/blob/main/docs/api-reference/table-border-style.md Demonstrates the visual output of a table using the `Rounded` border style, which utilizes Unicode box-drawing characters. ```text +-----------+---------+ | Name | Value | +-----------+---------+ | FirstName | John | | LastName | Doe | +-----------+---------+ ``` -------------------------------- ### CLI Tool for Data Analysis Source: https://github.com/moaidhathot/dumpify/blob/main/docs/examples/real-world-scenarios.md This code sets up a command-line interface (CLI) tool using the 'System.CommandLine' library. It defines an 'analyze' command with a '--path' option to specify a data directory. The handler analyzes data and dumps summary, issues, and recommendations. Assumes 'AnalyzeDataAsync' is implemented. ```csharp // dotnet run -- analyze --path ./data var rootCommand = new RootCommand("Data Analysis Tool"); var analyzeCommand = new Command("analyze", "Analyze data files"); var pathOption = new Option("--path", "Path to data directory"); analyzeCommand.AddOption(pathOption); analyzeCommand.SetHandler(async (string path) => { Console.WriteLine($"Analyzing: {path}"); var results = await AnalyzeDataAsync(path); results.Summary.Dump("Analysis Summary"); results.Issues.Dump("Found Issues"); results.Recommendations.Dump("Recommendations"); }, pathOption); rootCommand.AddCommand(analyzeCommand); await rootCommand.InvokeAsync(args); ``` -------------------------------- ### DumpText() - Get Output as String Source: https://context7.com/moaidhathot/dumpify/llms.txt Returns the formatted output as a string without writing to any output target. It defaults to no colors and wider dimensions (1000x1000). ```APIDOC ## DumpText() - Get Output as String Returns the formatted output as a string instead of writing to any output target. Uses no colors by default and wider dimensions (1000x1000). Note: returns `string`, not the original object. ```csharp using Dumpify; var order = new { Id = 1001, Total = 99.99m, Items = new[] { "Widget", "Gadget" } }; // Get formatted string string output = order.DumpText(); string labeledOutput = order.DumpText("Order Details"); // Use in logging logger.Info(order.DumpText("Request Data")); // Write to file File.WriteAllText("dump.txt", order.DumpText()); // Testing assertions var result = order.DumpText(); Assert.Contains("1001", result); // String building for reports var sb = new StringBuilder(); sb.AppendLine("=== Daily Report ==="); sb.AppendLine(order.DumpText("Current Order")); sb.AppendLine(metrics.DumpText("Metrics")); ``` ```