Get refreshed data using LINQ to SQL
I know that while iterating on an IQueryable variable, a request is sent to the database, but if the data is updated in the database new data is not shown during the iteration until Refresh is not开发者_C百科 called on DataContext.
So what is the reason of always sending the request to the database if the updated data will not be available, and is there a way to always show updated data automatically without calling Refresh all the time?
I understand one advantage is that it returns newly added records, but what about updated?
This might be helpful: LINQ to SQL Tips 6: How to refresh given DataContext won't stomp on your objects
Also: Refreshing the LINQ to SQL DataContext by Clearing the Cache
精彩评论