Support value tuples in addition to objects
scharnyw opened this issue · 0 comments
scharnyw commented
Run the following snippet:
var objects = new[]
{
new
{
Column1 = "value1",
Column2 = "value2"
},
new
{
Column1 = "value3",
Column2 = "value4"
}
};
ConsoleTable
.From(objects)
.Write();
var tuples = new[]
{
(
Column1: "value1",
Column2: "value2"
),
(
Column1: "value3",
Column2: "value4"
)
};
ConsoleTable
.From(tuples)
.Write();
Writing anonymous type objects succeed with no problem but doing it with (un)named value tuples fails with System.Exception: 'Please set the columns first'
.
Considering that value tuples are popular these days for doing a quick projection, etc. it would be nice if they can be supported. I can submit a PR if contributions are welcome.