Developed as a free alternative of ObjectDumper.NET, which is not free for commercial use.
using System;
using VarDump;
var anonymousObject = new { Name = "Name", Surname = "Surname" };
var cs = new CSharpDumper().Dump(anonymousObject);
Console.WriteLine(cs);
var vb = new VisualBasicDumper().Dump(anonymousObject);
Console.WriteLine(vb);
using System;
using System.ComponentModel;
using VarDump;
using VarDump.Visitor;
var person = new Person { Name = "Nick", Age = 23 };
var dumpOptions = new DumpOptions { SortDirection = ListSortDirection.Ascending };
var csDumper = new CSharpDumper(dumpOptions);
var cs = csDumper.Dump(person);
var vbDumper = new VisualBasicDumper(dumpOptions);
var vb = vbDumper.Dump(person);
// C# string
Console.WriteLine(cs);
// VB string
Console.WriteLine(vb);
class Person
{
public string Name {get; set;}
public int Age {get; set;}
}
using System;
using System.Linq;
using VarDump.Extensions;
using VarDump.Visitor;
var dictionary = new[]
{
new
{
Name = "Name1",
Surname = "Surname1"
}
}.ToDictionary(x => x.Name, x => x);
Console.WriteLine(dictionary.Dump(DumpOptions.Default));
using System;
using System.Linq;
using VarDump.Extensions;
using VarDump.Visitor;
VarDumpExtensions.VarDumpFactory = VarDumpFactories.VisualBasic;
var dictionary = new[]
{
new
{
Name = "Name1",
Surname = "Surname1"
}
}.ToDictionary(x => x.Name, x => x);
Console.WriteLine(dictionary.Dump(DumpOptions.Default));
For more examples see Unit Tests
Repository | License |
---|---|
Heavily customized version of System.CodeDom |
Privacy Notice: No personal data is collected at all.
This tool has been working well for my personal needs, but outside that its future depends on your feedback. Feel free to open an issue.
Any donations during this time will be directed to local charities at my own discretion.