There's no need to abuse string interpolation for your
ToString
method - just return the property directly:
public override string ToString()
{
return this.academic.Name;
}
The
File.AppendAllLines
method expects the second parameter to be an
IEnumerable<string>
, but you are passing in a
string
instead. You need to pass in a list containing the string representation of each item. LINQ makes this particularly easy:
File.AppendAllLines(@"C:\pg\Gold\BRdata.txt", LinkRecords.Select(r => r.ToString()));
File.AppendAllLines(@"C:\pg\Gold\BRdata.txt", LinkRecords.Select(r => r.academic.Name));