This three-day course provides a practical hands-on introduction to developing web applications using ASP.NET MVC 5 and C#. This development framework from Microsoft emphasizes separation of concerns in the architecture and test-ability of applications. This course covers the Razor View Engine, Entity Framework 6 and ASP.NET Web API 2. It also introduces Windows Azure and the deployment of ASP.NET MVC applications to the Azure cloud. Course content also covers the fundamentals of the Model-View-Controller design pattern and its implementation in ASP.NET MVC. In addition to teaching the main components of Model, Controller and View in detail, the course introduces automated unit testing of web applications (one of the chief advantages of the new technology) and presents a comparison of the new technology with classical ASP.NET web forms. Security is also covered, with some hands-on illustrations of attacks and defenses against them.

Course Duration: 3 Days
Prerequisites:

A good working knowledge of C# and the .NET Framework is required. Participants should also have a basic knowledge of ASP.NET and HTML.

Course Outline:
  • Introduction to ASP.NET MVC
    • Review of ASP.NET Web Forms
    • Advantages and Disadvantages of Web Forms
    • Model-View-Controller Pattern
    • ASP.NET MVC
    • Advantages and Disadvantages of ASP.NET MVC
    • Goals of ASP.NET MVC
    • Unit Testing
    • Using JavaScript
  • Getting Started with ASP.NET MVC
    • An ASP.NET MVC 5 Testbed
    • Starter Application
    • Simple App with Controller Only
    • Action Methods and Routing
    • Action Method Return Type
    • Rendering a View
    • Creating a View in Visual Studio
    • The View Web Page
    • Dynamic Output
    • Razor View Engine
    • Embedded Scripts
    • Using a Model with a ViewBag
    • Controller Using the Model and ViewBag
    • View Using the Model and ViewBag
    • Using Model Directly
    • A View Using Model in Visual Studio
    • View Created by Visual Studio
    • Passing Parameters in Query String
  • ASP.NET MVC Architecture
    • The Controller in ASP.NET MVC
    • The View in ASP.NET MVC
    • The Model in ASP.NET MVC
    • How MVC Works
    • Using Forms
    • HTML Helper Functions
    • Handling Form Submission
    • Model Binding
    • Greet View
    • Input Validation
    • Nullable Type
    • Checking Model Validity
    • Validation Summary
  • The Model
    • Microsoft Technologies for the Model
    • SmallPub Database
    • ADO.NET
    • Language Integrated Query (LINQ)
    • ADO.NET Entity Framework
    • SmallPub Tables
    • SmallPub Entity Data Model
    • Entity Data Model Concepts
    • Querying the EDM
    • Class Diagram
    • Context Class
    • List of Categories
    • List of Books
    • A LINQ Query o
    • IntelliSense
    • Controller
    • Web.config
    • Using a Parameter
    • Modifying a Data Source
    • Entity Framework in a Class Library
    • Data Access Class Library
    • Client Code
    • ASP.NET MVC Database Clients
    • NuGet Package Manager
    • Visual Studio Extensions
    • Online Gallery
    • Entity Framework 6 via NuGet
  • The Controller
    • IController Interface
    • A Low-Level Controller
    • Displaying Context
    • Add and Subtract
    • Controller Base Class
    • Action Methods
    • HomeController
    • MathController
    • Invoking MathController
    • Receiving Input
    • Non-Nullable Parameters
    • Nullable Parameters
    • Using a Model
    • HTML Output
    • Filters
    • Asynchronous Controllers
  • The View
    • Action Results
    • JavaScript Object Notation
    • Action Method Attributes
    • View Responsibility
    • A Program without a View
    • A Program with a View
    • View Page
    • Passing Data to the View
    • Passing Lists to the View
    • HTML Helper Methods
    • Link-Building Helpers
    • Form Helpers
    • Validation Helpers
    • Templated Helpers
    • Validation in Model
    • Validation in Controller
    • ValidationMessage Helper
  • Routing
    • ASP.NET Routing
    • Routing in ASP.NET MVC
    • RouteCollectionExtensions Class
    • Default Values for URL Parameters
    • Using a Default Route
    • HomeController
    • Assigning Parameter Values
    • Controller Code
    • View Code
    • Properties of Routes
    • UrlParameter Optional
    • A Problem with the Route Map
    • Matching URLs to Route
    • Route Debugging Utility
    • Multiple Matches
    • Fixing the Bug
    • Debugging Routes
    • Areas
  • Unit Testing
    • Test-Drive Development
    • Functional Tests
    • Unit Tests
    • Test Automation
    • Refactoring
    • Regression Testing
    • Unit Testing in ASP.NET MVC
    • Installing NUnit via NuGet
    • oA Test Class Library
    • The Model
    • Testing the Model
    • Structure of Unit Tests
    • Assertions
    • Visual Studio Unit Framework
    • Assert Class oAssert.AreEqual()
    • CollectionAssert Class oStringAssert Class
    • Test Case
    • Test Methods, Class, Runner
    • Ignoring Tests oFixing the Bug
    • Testing Controllers
    • Classes with External Dependencies
    • Dependency Injection
    • Mocking Frameworks
    • Using Moq
    • Models
    • Controller
    • Index View
    • Monthly Payment View
    • Unit Tests
    • Inversion of Control (IoC) Containers
  • Security
    • Web Security
    • Input Forgery
    • Cross-Site Scripting
    • Entering JavaScript
    • The Attack
    • What Allowed the Attack
    • Blocking the Attack
    • Using Razor
    • Session Hijacking
    • Cross-Site Request Forgery
    • Controller and Model Code
    • View Code
    • Attacker Code
    • The Defense
    • SQL Injection
    • Using the MVC Framework Securely
    • Authorize Attribute
    • ChildActionOnly Attribute
    • RequireHttps Attribute
    • ValidateInput Attribute
  • Combining ASP.NET MVC and Web Forms
    • Using Web Forms in an MVC Application
    • Linking and Redirecting from Web Forms Pages to MVC Actions
    • Default.aspx
    • Sharing Data between ASP.NET MVC and ASP.NET Web Forms
    • Using Web Form Controls in MVC Views
    • Using MVC in a Web Forms Application
    • Steps to Create Hybrid MVC – Web Forms Application
    • Web Forms MVC Interop in VS 2013
  • ASP.NET Web API
    • REST
    • Representation, State and Transfer
    • Collections and Elements
    • Specifying a Start Page
    • Implementing PUT Verb
    • Using Fiddler
    • Composing a Request
    • ASP.NET MVC and We API
    • Route Registration
    • HTTP Response Codes
    • POST Response Code
    • HttpResponseException
    • Web API Clients
    • HttpClient
    • Initializing HttpClient
    • Issuing a GET Request
    • Issuing a POST Request
    • Performing CRUD Operations
    • Book Repository
    • BooksController
    • View
    • Exercise the Server Using Fiddler
    • Client Code: Book Class, Program Class
    • ShowBooks()
    • AddBooks()
    • Update and Delete
  • Deployment on Windows Azure
    • What is Windows Azure?
    • A Windows Azure Testbed
    • Publish to Azure
    • Import Publish Settings
    • Manage Azure Subscriptions
    • Sign into Windows Azure
    • Download Subscription File
    • New Publish Settings
    • Create a Site on Windows Azure
    • Publish
    • Web Deployment Completed
    • Modifying a Web Application
    • Publish to a New Site
    • Deploy to Original Site
    • Publish Preview
  • Appendix A: Learning Resources
  • Appendix B: Deployment in IIS 7.5
    • Internet Information Services
    • Installing IIS 7.5
    • MVC with IIS 7.5
    • .NET Framework Version
    • Registering ASP.NET
    • Convert to an Application
    • XCOPY Deployment