My application is a client/server solution using an ADO.NET Data Service. The Data Service exposes transactionSummaryData as follows:
public IQueryable<TransactionSummary> TransactionSummaries
{
get { return MainForm.transactionSummaryData.Items.AsQueryable(); }
}
The transactionSummaryData is of type TransactionSummaries whose items property is defined as follows:
public List<TransactionSummary> Items
On the client side, I have some controls databound to a LINQ query which works on the TransactionSummaries:
AvailibilityBox.DataContext = (from salesdata in srv.TransactionSummaries
where salesdata.PerformanceID == selectedshow.performancedata.PerformanceID
select salesdata);
This gets executed many times as selectedshow.performancedata.PerformanceID changes in response to the user navigating the UI.
All good so far. However, when the transactionSummaryData on the server is updated by some other code within the server, the client continues to display 'stale' data and doesn't notice the update. I assume this is due to some kind of caching. Having debugged the code, I can see the server sending the right data but the LINQ query on the client continues to return the stale data. Restarting the client causes the correct data to be displayed.
I think i'm missing something obvious here, but I can't see how to control any caching on the client or invalidate the object without re-making the connection.