User475983607 posted
Basically, the record variable is a reference type pointing to a memory location. When the loop completes the generic type, records, contains four pointers to the same memory location which has a 4.
The basic problem you are facing is not understanding how the ExpandoObject works. The following will work but I'm not sure if this is will work in your application.
var records = new List<dynamic>();
dynamic record;
for (int i = 0; i < 5; i++)
{
record = new ExpandoObject();
record.Name = i;
records.Add(record);
}
foreach(var item in records)
{
Console.WriteLine(item.Name);
}