I like automapping feature but it also maps all referenced classes of my class and it it too difficult to ignore them after. Is there any way to ignore all references or ignore them on the automapping step?
No, but this would be a good feature.
For now, you could throw an Ignore attribute on the properties you don't want used.
This exists. I must have missed closing this when it happened.
void Main()
{
var s = new StringBuilder();
s.AppendLine("Id,Name");
s.AppendLine("1,one");
s.AppendLine("2,two");
using (var reader = new StringReader(s.ToString()))
using (var csv = new CsvReader(reader))
{
csv.Configuration.IgnoreReferences = true;
csv.GetRecords<A>().ToList().Dump();
}
}
public class A
{
public int Id { get; set; }
public B B { get; set; }
}
public class B
{
public string Name { get; set; }
}
Most helpful comment
This exists. I must have missed closing this when it happened.