Create a application that shows off the awesome sauce of Entity Framework Code Frist, Entity Framework Migration, MVC4 WebApi, and HTML5 + other clients
This series is to show off a step by step example application that will be presented at the March 22, 2012 SW Florida .Net Developers Group. As stated above this will show off some feature rich technologies available today to build a modern web application.
Let me just start off by saying I am not perfect and as with all my post/work if there is a better way of doing it I will be happy to add it.
This sample application is available on github repo. This post will cover what is needed and the initial steps to get started. You can either download the code or follow along. Without further adieu lets get to it.
Here is what we need to start off or what I am using for this initial demo. I am using some extra stuff not because you have to but life is so much easier with the extras. I will mark the extras. Go ahead and download each of these if you have not done so already and install them. If you need help either let me know or check there respective support sites.
- Visual Studio 2010 – I have done some minor testing with Visual Studio 2011 and all seems ok so far.
- NuGet – It has been so long, I think this is installed with SP1 for Visual Studio
- SQL Express 2010 R2 – SQL Express 2012 works fine
- Chinook Database – Download and install the Chinook Database.
- ASP.NET MVC 4 – The latest version includes WebAPI
- PostSharp – **Extra** this is like American express I never leave home without it. Read my past blogs for the greatness and cost savings this tool offers.
- PostSharp-Aspects – **Extra** my public NuGet package of aspects
- IIS Express – **Extra** I like this over the built in application server
- Notepad++ – **Extra** This with a the plug in JSONViewer allows a developer to display the return file in a cleaner format.
- Fiddler 2 – **Extra** Makes life easier to troubleshot HTTP options. In my opinion this needs to be in every developers bag of tricks.
Once the above are installed and ready to go, the final part of this post will be the setup of the main project.
- Open up your Visual Studio and go to file –> new project.
- Under Visual C# –> select Web –> Select ASP.NET MVC 4 Web Application
- For name I chose ChlodnyWebApi –> click OK
- From the New ASP.NET MVC 4 Project select Web API and keep the view engine as Razor –> click OK
- Update the NuGet packages,
- Right click on the ChlodnyWebApi Solution –> select Manage NuGet packages for solution
- Installed packages –> select jQuery UI and select Manage –> Uncheck the boxes and select OK (we are going to use a separate client so we do not need this here)
- Go to Updates
- Update those that are remaining, Entity Framework 4.3.x+ is an important update as it will be used later to show off the new migration feature.
- Close the NuGet Package manager.