4

I read about the SQL Azure and Entity Framework Connection Fault Handling article that describes about implementing Retry Policy in OnContextCreated (for ObjectContext). How to achieve the same for Entity Framework Code First DbContext?

2 Answers 2

1

Check out this blog post. It's got the answer you are looking for.

http://blogs.msdn.com/b/cesardelatorre/archive/2012/04/24/entity-framework-code-first-dbcontext-and-sql-azure-connection-fault-handling.aspx

Sign up to request clarification or add additional context in comments.

Comments

0

I have this problem as well, and I think I have a possible solution. This code by Microsoft can be used to create a reliable connection. In your DbContext class override the constructor to use the reliable connection (see this post for an example). The only problem is Microsoft's connection is an IDbConnection and the DbContext is using DbConnection.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.