Connecting to a SQL Database with Entity Framework
The Azure SQL Database is a SQL Server-like fully managed relation database engine. In many other recipes, we showed you how to connect transparently to the SQL Database, as we did in the SQL Server, as the SQL Database has the same TDS protocol as its on-premise brethren. In the Connecting to a SQL Database with ADO.NET recipe, we see how to connect directly with ADO.NET, which is very efficient but requires much work from the developer. In addition, using the raw ADO.NET could lead to some of the following issues:
Hardcoded SQL: In spite of the fact that a developer should always write good code and make no errors, there is the finite possibility to make mistakes while writing stringified SQL, which will not be verified at design time and might lead to runtime issues. These kinds of errors lead to runtime errors, as everything that stays in the quotation marks compiles. The solution is to reduce every line of code to a command that is...