About this course

Course type Performance
Course code QAASPNETMVC
Duration 5 Days

The course takes existing .NET developers and provides them with the necessary skills to develop modern MVC-5 web-based applications, using Visual Studio 2015 and the ASP.NET Framework 4.51 (using the Repository and Unit Of Work Patterns). This course prepares delegates for Exam 70-486.

Prerequisites

  • Delegates should have basic knowledge of HTML and web page creation using JavaScript and CSS. These skills can be obtained by attending QA's Building an Effective Web Site course
  • Delegates should have existing knowledge of C#4 (ie LINQ/Lambdas) and have worked with the .NET Framework for 3 months minimum. (VB.NET delegates should be comfortable reading C#).
  • Delegates without these skills would benefit from attending the QA C# programming language course.
  • Delegates are not required to have any experience in ASP.NET WebForms development.

Please note: Before attending this class delegates must have a Microsoft account (signing up one is free). The instructions on how to set up a Microsoft account can be found here.

Outline

Module 1: Web Basics

This is a 'refresh' chapter for those not confident with web terminology. It is brief and only intended as a refresh - not a 'learn from cold'. There is no lab.

Module 2: MVC5 Overview

In this module, delegates learn about the separation of concerns, working with Models, Controllers and Views to understand how a MVC application is structured and how the different parts interact with the routing engine to resolve a client request. Lessons:

  • The MVC Pattern
  • The MVC Pattern
  • Models, Views, and Controllers ASP.NET MVC Conventions MVC5 Project structure
  • Visual Studio 2015 support
  • Nuget
  • Creating an ASP.NET MVC 5 project using Visual Studio 2015 After completing this module delegates will:
  • Have gained a high-level overview of how to build an MVC-5 application

Module 3: Entity Framework

Because Entity Framework is such an important part of most MVC applications, we cover the topic before exploring models.

Lessons:

  • The main features of Entity Framework
  • DatabaseFirst / ModelFirst / CodeFirst / CodeFirst from Database
  • Lazy / Eager / Explicit loading
  • Linq To Entities
  • Initialization and Migration
  • Using Stored Procs
  • CodeFirst and loading options
  • (Optional) Initialization and Migration
  • Know the different strategies available in Entity Framework
  • Know how and when to use Initialization and Migration

Module 4: The Data Storage Pattern

Delegates will work with the Entity Framework to build the models for an MVC-5 application. They will learn how to properly encapsulate data access logic using the Unit of Work and Repository pattern. This pattern is then used for all subsequent labs.

Lessons:

  • The Repository Pattern
  • The Unit of Work Pattern
  • The Dependency Injection Pattern
  • The Model (correctly known as the ViewModel)
  • How Entity Framework fits in
  • The Structure


Labs:

  • Create Repository, Unit of Work structures using Dependency Injection and Entity Framework.

After completing this module delegates will be familiar with Entity Framework, the Repository pattern and the Unit of Work Pattern

Module 5: Controllers and Actions

Delegates learn how to structure and build controllers for key entities by learning how to write actions that return views for different scenarios. The usage of the Http Get and Post verbs in building forms is discussed. Lessons:

  • What is a controller? Action and parameters
  • Returning Results from Actions Passing data to views Asynchronous Actions Processing HTTP Forms
  • Building controller classes
  • Understand the role of the controller
  • Be able to write Actions to process requests

Module 6: Unit Test

This module teaches delegates to use Visual Studio Unit Testing capabilities to carry out Test Driven Development (TDD) within an application, including the use of Mocks and Stubs. They will implement Dependency Injection and appreciate how to create a mock HttpContext for use when testing MVC 5 projects. Lessons:

  • Test Driven Development (TDD)
  • Writing tests in Visual Studio
  • Mocking the HttpContext
  • Implement Test Driven Development
  • After completing this module delegates will:
  • Understand the principles of Test Driven Development (TDD)
  • Know how to implement Unit Tests using Visual Studio
  • Know how to use a mocking framework

Module 7: Creating Views

Delegates create views and partial views using the Razor engine. They will learn how to render client side mark-up, based on what the Controller's request and the Model sends. Delegates learn how to create master layout pages to enforce a consistent layout and style across a website, plus how to implement forms for the websites 'Create', 'Update' and 'Delete' pages.

Lessons:

  • Using views and partial views Razor
  • Layout pages Using data in views
  • Strongly Typed Views
  • Implementing views and partial views After completing this module delegates will:
  • Be able to use the Razor engine to render views and partial views. Create master layout pages for a consistent look and feel.
  • Use Helper methods to generate client side mark-up. Know how to access model data from within Views

Module 8: Bootstrap

In this module delegates work with Bootstrap. They will use the various Bootstrap styles to customise the look and feel of awebsite. Become familiar with the Bootstraps grid system to control the layout of content and how bootstrap provides a responsive design.

Lessons:

  • Bootstrap getting started Bundling and Minification Bootstraps responsive design Bootstrap components Lab:
  • Styling webpages with Bootstrap
  • Know how to use the Bootstrap UI Framework
  • Be able to create mobile-first responsive web pages

Module 9: Model Binding

Delegates will learn what Model Binding is and how the MVC framework leverages this.

Lessons:

Model Binding Lab:

The model binding lab is included in the following chapter

Module 10: Validation

Delegates will learn to use data annotation attributes to provide validation for the model data. They use html helpers to provide validation assistance within views.

Lessons:

  • Data Annotations and Validation Attributes Preventing JavaScript Injection attacks

Lab:

  • Model Validation

After completing this module delegates will:

  • Understand the Model Binding process.
  • Be able to use Data Annotations and Validation attributes within model classes

Module 11: Error Handling

Delegates will learn how to protect a MVC application from script injection attacks, and how to implement custom exception handling within the application.

Lessons:

  • Error handling
  • Exception bubbling
  • The default error page
  • Error filters

Lab:

  • Error handling

After completing this module delegates will:

  • Provide custom error handling for a MVC application.

Module 12: Action filters

Delegates will use Action Filters to control the behaviour of an application. They will first use the built-in filters, then learn to create custom Action Filters. Delegates will also make use of global Action Filters, applying them both statically and dynamically.

Lessons:

  • What are Action Filters? Types of Action Filter Using Action Filters
  • Creating Custom Action Filters Adding global filters

Lab:

  • Using Action Filters

After completing this module delegates will:

  • Know the different types of filters available
  • Be able to use a built-in Action Filters Create a custom Action Filter
  • Configure global filters

Module 13: Routing

Delegates learn how to create routes that map URLs to controller actions using both convention-base routing and attribute-based routing. They will implement routing constraints to ensure that routes contain the expected data, and how to use Glimpse to de-bug and test complex route configurations.

Lessons:

  • What are routes? Defining and using routes
  • Convention-based Routing Attribute-based Routing Debugging routes Lab:
  • Configuring and de-bugging routes
  • Understand the purpose of routes.
  • Know how to add literals and constraints to routes. Know the benefit of Areas.
  • Be able to use Glimpse to de-bug routes.

Module 14: Web API 2

Delegates learn when and how to create a restful service using Web API 2. They will learn to use Fiddler2 to help test and debug Web APIs during development and how to call a Web API from multiple clients. Lessons:

  • WCF v. Web API2
  • The HTTP Protocol Content negotiation Web API2 Controllers Routing
  • Error handling Lab:
  • Creating and calling Web API Services
  • Understand the Web API framework
  • Learn about the HTTP requests and responses Know how to create a Web API
  • Be able to consume a Web API from a variety of devices

Module 15: State

Delegates learn about the various ways of maintaining state within a web server, how different state options affect the scalability of an application, and how to use page output caching and application caching service providers to improve application performance.

Lessons:

  • State management
  • Maintaining state between requests Maintaining state across all requests Maintaining state between user sessions

Lab:

  • Managing and maintaining state

After completing this module delegates will:

  • Understand the various techniques for state management.


Module 16: Caching

Performance is often an issue with any web site. In this module delegates use the output and data caching features of the product to improve performance

Lessons:

  • Output caching
  • Data caching Lab:
  • Output and Data caching

Module 17: AJAX

Delegates will learn how to make use of AJAX helpers and partial views to do client-side partial updates, and when to use JQuery to gain greater control when making Ajax calls to a server.

Lessons:

  • What is AJAX
  • AJAX Frameworks ASP.NET AJAX jQuery
  • Visual Studio support
  • Enhancing an MVC application with AJAX

After completing this module delegates will:

  • Understand the need for AJAX
  • Know how to implement jQuery in an MVC application

Module 18: Security

Module 15 examines the ASP.NET Identity infrastructure that is added automatically when creating new MVC projects. Delegates will see the security options available and also how to configure, integrate and extend ASP.NET Identity.
Lessons:

  • ASP.NET Identity Authorization
  • Individual User Accounts
  • Organizational Accounts (aka Work and School Accounts)
  • A number of labs are provided (most of them optional) so delegates can become familiar with the available options.
  • Add avatar to user
  • Email confirmation of registration
  • Password recovery
  • Authorization by role
  • Two factor authentication

After completing this module, the delegates will have an understanding of the security infrastructure provided in MVC

Module 19: Deploying

The delegates learn about the different deployment options available. They learn how to create deployment packages to deploy MVC applications into IIS and Azure, and how to use configuration transforms to modify web.config during deployment.

Lessons:

  • Deployment Options
  • Working with Packages Configuring Deployment Options Applying Transforms Lab:
  • Deploying Web Applications to Azure Lab:
  • Change to the Entity Framework migration strategy
  • Deploy to IIS
  • Deploy to Azure (for those with an Azure account)
  • Know how to deploy ASP.NET MVC 5 applications to hosting servers and Microsoft's Azure
  • How to create and configure deployment profiles

Appendix: OWIN, Katana and SignalR

An overview is provided for how OWIN and Katana provide a pathway to ASP.NET MVC running on other servers. We also include an overview of the SignalR technology.

Lessons:

  • OWIN, Katana and middleware
  • SignalR overview
  • Adding real-time functionality to a web application After completing this module delegate will:
  • Know how to add real-time capabilities to a web application using the SignalR APIs

Performance

5 Days

Duration
Microsoft Visual Studio
Delivery Method

Delivery method

Classroom / Attend from Anywhere

Receive classroom training at one of our nationwide training centres, or attend remotely via web access from anywhere.

Trusted, awarded and accredited

Fully accredited to ensure we provide the highest possible standards in learning

All third party trademark rights acknowledged.