The .NET Framework 4.5 introduces a number of features to help solve the programming problems of today. This sample demonstrates end-to-end how to build a Windows 8 app that connects to a web backend using industry standard REST APIs. If you were at TechEd
North America or
Europe, we showed you how to build this sample from scratch. The app itself is a catalog of some features found in the .NET Framework, so you can learn more about .NET simply by exploring the app.
Building the Sample
Even though we're providing the .NET Feature Catalog sample in its final form, you need to populate the database before running it. To do that:
- Open the DotnetCatalogSample.sln solution file in Visual Studio 2012.
- Right click on the WebBackend project and Set as StartUp Project.
- Open the Package Manager Console (easiest to find via the Quick Launch control via CTRL+Q).
In the package manager console, run the following command:
Update-Database -ProjectName WebBackend
- Right click on the DotnetCatalog project and Set as StartUp Project.
- Run the app.
NOTE: This sample is slightly revised from what we presented at TechEd 2012.
The sample is best experienced by watching the talk for What's New in .NET 4.5 from TechEd 2012. Click on either of the following to see the presentation given by Brandon Bray or Layla Driscoll respectively.
The main features we cover in the sample are:
- WebAPI for building REST based web services
- Entity Framework using Code First and migrations
- Windows Store app using the .NET for Windows Store Apps profile
- Async and await to build a fast and interactive user experience
- HttpClient for an easy way to connect to a web service
- NuGet for acquiring the latest libraries, specifically Json.NET
Source Code Files
This sample was created with the default project templates for Windows Store Grid App and an ASP.NET MVC 4 Web Application. The files that were edited during the TechEd demo were:
- DotnetCatalog/DataModel/FeatureDataSource.cs - used async, HttpClient, and Json deserializing
- WebBackend/Controllers/FeaturesController.cs - contains the REST APIs for the feature data
- WebBackend/Controllers/FeaturesSummaryController.cs - contains the REST APIs for the feature summary data
- WebBackend/Models/Feature.cs - contains the data model for the feature entity
- WebBackend/Models/FeatureContext.cs - used entity framework
- WebBackend/Models/FeatureSummary.cs - contains the data model for the feature summary entity
- WebBackend/WebAssets - the media and text data transferred from the web backend to the Windows app
The MSDN topic for
What's New in the .NET Framework 4.5 has a complete list of the new functionality. For the latest discussion about .NET, follow the
.NET Team Blog or reach us on