I'm creating an API meant to consume data on an exiting SQL Azure database. I'm creating this API based on ASP.NET's Web API 2.
I'm a complete newbie on this area. This is why I've been following ASP.NET tutorials. I'm able to create a Web API and create models/controllers. But on the database side, every tutorial I come across is about creating a database from the scratch dedicated for the API, not about connecting an existing database that is consumed by the API.
How can I make the connection and query the database from the API?
Tutorials I've followed
- Using Web API 2 with Entity Framework 6: http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1
- Create a REST service using ASP.NET Web API and SQL Database in Azure App Service: https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-rest-service-aspnet-api-sql-database/
connectionStringand try reading about how to use thatconnectionStringto consume database..