This year at the //build/ conference I presented a session titled ‘Building data centric applications for web, desktop and mobile using EF5’. In addition to EF5, I also covered the what and when of EF6 and did a quick demo of my favorite EF6 feature (custom code first conventions).
You can view the session recording, and download it in various formats, from the //build/ website.
The majority of the session was spent coding in Visual Studio. During the session I built a Park Finder application starting from File –> New Project.
I’ve published the source code for the Web and Desktop projects that I built during the session.
To use the Park Finder web page you will need to get your own Bing Maps key and enter it on line 10 of Views\Home\Index.cshtml.
I’ve added the following line to Global.asax so that the migrations will be automatically applied when you run the application. This means you don’t have to worry about running Update-Database to create the database schema before running the application, although you can if you want.
Database.SetInitializer(new MigrateDatabaseToLatestVersion<ParkFinderContext, Configuration>());
You will need to be using Windows 8 to use this solution (because it’s a Windows 8 application).
Make sure you have the Bing Maps SDK for Windows Store apps installed.
The ParkFinder.Web project must have been run so that the Park Finder Web API is running.
You will need to get your own Bing Maps key and enter it on:
- Line 34 of MainPage.xaml
- Line 57 of MainPage.xaml.cs