MVC: Entity Framework

Please see my other MVC articles. Using Microsoft’s powerful ORM tool to perform data-layer operations. Most tasks performed in today’s data-driven websites revolved around one or more of the Create-Retrieve-Update-Delete (C.R.U.D.) operations. Microsoft has provided a very elegant, easy-to-use, yet powerful tool that abstracts a lot of the complexity necessary for most CRUD operations while…

MVC: Custom Model

Please see my other MVC articles. Developing a custom model to encapsulate a unique domain. The Model serves as the heart of the MVC application, containing a domain’s business logic. In this example, I will illustrate how to create a custom Model representing a typical sales associate within any company. Also, I will build a Create View…

MVC: ContentResult

Please see my other MVC articles. Returning different types of content. MVC provide flexibility when answering requests for resources by supporting different types of content. In this article, I will illustrate the use of the ContentType to return plain text and XML. Here I have a simple example of how a Controller may return plain…

MVC: C.R.U.D. Operations

Please see my other MVC articles. Using Entity Framework to leverage CRUD operations within a website. Most tasks performed in today’s data-driven websites revolved around one or more of the Create-Retrieve-Update-Delete (C.R.U.D.) operations. Microsoft has provided a very elegant, easy-to-use, yet powerful tool that abstracts a lot of the complexity necessary for most CRUD operations…

MVC: Action Methods with Parameters

Please see my other MVC articles. Passing arguments to action methods. It’s often necessary when calling an action method to pass to it variables necessary for business logic. In this article, I will illustrate one method that is similar to the Web Forms programming model of using the question mark + equals sign convention (?VariableName=Value).…

MVC: Action Methods using GET & POST

Please see my other MVC articles. Enabling specific actions for GET and POST calls. MVC provided an elegant method to specify actions based on the type of call used by the webpage – GET (default) Http verb or POST Http verb. To illustrate this ability, I’ll begin where my Form Validation article left off with…

Design Patterns: Singleton

Please see my other Design Pattern articles. Ensuring single instance use during instantiation. Every so often in development, a business rule dictates that instantiation of a certain type produce only one instance during the lifetime of the application. The Singleton design pattern, one of the Creational Patterns, ensures that regardless of many instantiations of a…