© Lee Naylor 2016

Lee Naylor, ASP.NET MVC with Entity Framework and CSS , 10.1007/978-1-4842-2137-2_2

2. Creating Views, Controllers, and a Database from Model Classes

Lee Naylor

(1)Newton-le-Willows, Merseyside, UK

In this chapter we will jump right into the project and add some basic model classes for products and categories. We will use these to create a database using Entity Framework Code First. I’ll show you how to set up a database context class, specify a connection string, create a database from your code, and add new views and controllers to manage and display the product and category data.


If you want to follow along with the code in this chapter, you must either have completed Chapter 1 or downloaded Chapter 1’s source code from ...

Get ASP.NET MVC with Entity Framework and CSS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.