Answered by:
SQL Azure and Entity Framework 4.1

Question
-
Hi there
I am planning to deploy an MVC3 with the entity Framwork 4.1 that attaches to SQL Azure and runs in Windows Azure with several instances. I am planning to use the DBContext with a CodeFirst Approach.
Questions:
- Is this a usual setup for the entity framwork or is it a special one?
- How is database caching supported in this scenario?
- Anything special I need to take care of?
Thank you,
Marc
Sunday, July 31, 2011 2:37 PM
Answers
-
Hi Marc,
Please see below responses
-
Is this a usual setup for the entity framwork or is it a special one?
Based on this forum post, it seems like there is an issue with creating tables with SQL Azure when using EF Code-First approach, but this post is based on CTP though
http://social.msdn.microsoft.com/Forums/da-DK/adonetefx/thread/1e828c99-66a9-4094-87ec-e799bd619463 -
How is database caching supported in this scenario?
There is no MVC specific Caching, you can use HttpRuntime.Cache object to cache your objects, Please read this article for a sample http://stackoverflow.com/questions/343899/how-to-cache-data-in-a-mvc-application -
Anything special I need to take care of?
Yes, Connection Handling has to be done for SQL Azure, Please read this article for more information
https://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx
Hope this helps !!!
Arunraj Chandrasekaran, MCTS, Author: SQLXpertise.com
If you found this post useful, Please "Mark as Answer" or "Vote as Helpful"- Marked as answer by Marc Loeb Sunday, July 31, 2011 6:22 PM
Sunday, July 31, 2011 4:43 PM -
Is this a usual setup for the entity framwork or is it a special one?
All replies
-
Hi Marc,
Please see below responses
-
Is this a usual setup for the entity framwork or is it a special one?
Based on this forum post, it seems like there is an issue with creating tables with SQL Azure when using EF Code-First approach, but this post is based on CTP though
http://social.msdn.microsoft.com/Forums/da-DK/adonetefx/thread/1e828c99-66a9-4094-87ec-e799bd619463 -
How is database caching supported in this scenario?
There is no MVC specific Caching, you can use HttpRuntime.Cache object to cache your objects, Please read this article for a sample http://stackoverflow.com/questions/343899/how-to-cache-data-in-a-mvc-application -
Anything special I need to take care of?
Yes, Connection Handling has to be done for SQL Azure, Please read this article for more information
https://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx
Hope this helps !!!
Arunraj Chandrasekaran, MCTS, Author: SQLXpertise.com
If you found this post useful, Please "Mark as Answer" or "Vote as Helpful"- Marked as answer by Marc Loeb Sunday, July 31, 2011 6:22 PM
Sunday, July 31, 2011 4:43 PM -
Is this a usual setup for the entity framwork or is it a special one?
-
Hi Arunraj
thanks for this - it is helpful! Here from stack overflow a connection retry:
http://stackoverflow.com/questions/6566030/entity-framework-code-first-and-sql-azure-connections
Sunday, July 31, 2011 6:25 PM