ConsoleTableExt icon indicating copy to clipboard operation
ConsoleTableExt copied to clipboard

List crashed when using with string type

Open palenshus opened this issue 1 year ago • 0 comments

Appears to be similar or same as the now-closed #25, I reproed on version 3.3. Running this

	var tableData = new List<List<string>> // If I change string to object it works
	{
		new() { "Sakura Yamamoto", "Support Engineer", "London", 46.ToString(), ""},
		new() { "Serge Baldwin", "Data Coordinator", "San Francisco", 28.ToString(), "something else" },
		new() { "Shad Decker", "Regional Director", "Edinburgh", "", ""},
	};

	ConsoleTableBuilder
		.From(tableData)
		.WithColumn("Name","Role","City","Age","Notes")
		.WithFormat(ConsoleTableBuilderFormat.Minimal)
		.ExportAndWriteLine();

results in

System.Reflection.TargetParameterCountException: Parameter count mismatch.
   at System.Reflection.MethodBaseInvoker.ThrowTargetParameterCountException()
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.PropertyInfo.GetValue(Object obj)
   at ConsoleTableExt.ConsoleTableBuilder.From[T](List`1 list)

palenshus avatar Sep 11 '24 18:09 palenshus