Closed OleksandrMyronchuk closed 1 year ago
@OleksandrMyronchuk I think you can convert your TestClass1
to another class ex ABClass
that just have only field A and B, then instruct ConsoleTableBuilder
use ABClass
by using .From
using System.Linq;
public class TestClass1
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
}
public class ABClass // <=============== new class
{
public string A { get; set; }
public string B { get; set; }
}
List<TestClass1> oldList = new List<TestClass1>();
oldList.Add(new TestClass1 { A = "a0", B = "b0", C = "c0" });
oldList.Add(new TestClass1 { A = "a1", B = "b1", C = "c1" });
List<ABClass> newList = new List<ABClass>();
newList = oldList.Select(x=> new ABClass{A = x.A, B = x.B}).ToList(); // <====== convert to new list
ConsoleTableBuilder
.From(newList) // <==================
.WithColumn("A", "B")
.ExportAndWriteLine();
Can you help me display only those rows that I want to
For example: there is the following code:
I would like to display only the "A" and "B" columns
How can I do this ?
So the question is: how to display specific columns ?