In the first
and second
parts of this article series I talked about the fundamentals of the Model View Controller
(MVC) pattern and the ASP.NET MVC framework as well as the controller concept
in the MVC pattern and its implementation in the ASP.NET MVC framework.
Moving on in this discussion, I want to implement KBlog with
the MVC framework as a simple blog engine and show the concepts related to the
ASP.NET MVC framework by using it as an example.
After getting started with controllers and learning the
basics about them, we need to find a way to load data from data storage in data
model and pass them to views in order to finalize the work on controllers.
For KBlog I'm using a SQL Express database with three simple
tables that you'll discover in a moment. In this part of the article series I
introduce you to the data model as the other main component in Model View
Controller (MVC) framework and the database structure then will use LINQ to SQL
to load data and pass the loaded data from LINQ to views in controllers.
Before stepping in the main body of the article let me say
that this part focuses on the data side and data model concepts of the KBlog and
MVC even though you'll see some final uses of our data model in the article.