The BusyFrontEnd sample code comprises the following items:
-
ChattyIO solution file
-
ChattyIO WebAPI project (Note that this project is an Azure web application and not a cloud service)
-
ChattyIO.DataAccess class library
The ChattyIO WebAPI project contains two controllers:
-
ChattyProductController
-
ChunkyProductController
The GetProductsInSubCategoryAsync
action of the ChattyProductController
retrieves the details of all products held, including price histories, in the specified subcategory in the AdventureWorks2012 database. The code connects to the database and fetches the details of the subcategory, the products in the subcategory, and the price history of each product as separate database requests before formatting the data and returning the result.
The GetProductCategoryDetailsAsync
action of the ChunkyProductController
performs a similar task except that it fetches the data from the database in a single request.
This project uses the AdventureWorks2012 database stored by using Azure SQL Database. Create the database by using the Azure Management Portal and add the connection string to the AdventureWorksProductContext
connection string in the web.config file for the ChattyIO WebAPI project. Note that the new Azure portal provides a simplified version of the database (AdventureWorksLT).
The AdventureWorksLT database uses a different schema from that expected by this sample
application which might not function correctly unless the full
AdventureWorks2012 database is installed.
In Visual Studio Solution Explorer, right-click the ChattyIO.WebApi project and then click Publish. Publish the project to an Azure website.
You can use Visual Studio Online to load test the application. For details of the load testing strategy for this sample, see Load Testing.
This project requires:
-
Azure SDK 2.5
-
An instance of the AdventureWorks2012 database