-
Book Overview & Buying
-
Table Of Contents
Microsoft .NET Framework 4.5 Quickstart Cookbook
By :
Our first application will create a database from code. We will start by creating an ASP.NET project that we will reuse in the following recipes.
In order to use this recipe, you should have Visual Studio 2012 installed.
Here we will create a Code First application and see the main concepts behind this technology and how to use it properly.
First open Visual Studio 2012 and create a new project. We will select the ASP.NET MVC 4 Web Application template from Visual C# | Web and name it EFCodeFirst as shown in the following screenshot:

Select the Internet Application template as shown in the following screenshot:

Next, we will create a class that we will use as the schema to create a table. We will add the BookModel class to the Models folder of our project as shown in the following code. Note that we will need to add a reference to System.ComponentModel.DataAnnotations.
namespace EFCodeFirst.Model
{
public class BookModel...
Change the font size
Change margin width
Change background colour