I am using this architecture with ADO.NET Entity Framework and have read several posts on how to accomplish this, but I still have questions on exactly when I need to wrap my calls in the retry block. Can you please answer the following question:
1) If I have the code below, which statements should be wrapped within the retry block? The Linq query, or the 1st call using the result set of the Linq query, or both? I am concerned about when it actually goes to the DB (Lazy Loading)
var ResultSet = from persons in Conn.Persons where persons.Gender == “Male” select persons;
int iPersonsCount = ResultSet.Count();
2) Do all calls using the result set need to be wrapped with retry blocks? Again this is a concern due to Lazy Loading, and when it goes to the DB.
3) If I am using ADO.NET entity framework, should I also over load the “OnContextCreated()” method, to wrap the connection object in a retry?