I have what I thought was a very simple piece of code, but the results puzzled me. I request objects using LINQ and then iterate over the results to create an array. I look at traffic to and from the database, and everything looks good there. When I copy a query that LINQ sends to SQL and runs it directly with SQL, I get the expected results. However, when I repeat the results - or even set the clock on the results - each record is exactly the same. This is NOT what SQL returns. What am I doing wrong?
var eventList = from e in entityContext.AuctionSet select e;
ArrayList DayArray = new ArrayList();
int i = 0;
foreach (Auction ae in eventList)
{
Auction temp = ae;
DayArray.Add(new {
id = i,
title = temp.County.ToString()
});
i++;
}
Thanks!
EDIT: Forgot to mention that entities come from a view, which makes sense given the comment on the primary key.
Jason