ASP.NET MVC Using C# - VS2019 Training in Santa Cruz
We offer private customized training for groups of 3 or more attendees.
|
||
Course Description |
||
This course provides a practical hands-on introduction to developing Web applications using ASP.NET MVC 5 and C#. This Web development framework from Microsoft emphasizes separation of concerns in the architecture and testability of applications. The course includes coverage of 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. The course covers the fundamentals of the Model-View-Controller design pattern and its implementation in ASP.NET MVC. This technology is compared with classical ASP.NET Web Forms. The two technologies share a common ASP.NET infrastructure. Visual Studio 2019 with .NET 4.7.2 is used as a productive platform for creating ASP.NET MVC applications. After presenting the fundamentals of the technology with several examples, the main components of Model, Controller and View are covered in detail. The discussion of the Model incorporates modern Microsoft data access technologies, including SQL Server 2016, LINQ and ADO.NET Entity Framework 6. The routing mechanism of ASP.NET MVC is covered. The course introduces automated unit testing of Web applications, one of the chief advantages of the new technology. Security is covered, with some hands-on illustrations of attacks and defenses against them. The course includes a discussion of how ASP.NET MVC and Web Forms can be used together in the same application. The course includes with an introduction to ASP.NET Web API and concludes with deployment to Windows Azure. An appendix covers deployment on IIS 7.5
Course Length: 3 Days
Course Tuition: $1190 (US) |
Prerequisites |
|
A working knowledge of C# and .NET Framework. Knowledge of JavaScript is recommended. |
Course Outline |
Chapter 1: Introduction to ASPNET MVC
Review of ASPNET Web Forms
Advantages of ASPNET Web Forms
Disadvantages of ASPNET Web Forms
Model-View-Controller Pattern
ASPNET MVC
Advantages of ASPNET MVC
Disadvantages of ASPNET MVC
Goals of ASPNET MVC
Unit Testing
Summary
Chapter 2: Getting Started with ASPNET MVC
An ASPNET MVC Testbed
Visual Studio ASPNET MVC Demo
Configure Your Project
ASPNET Documentation Page
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
Embedded Script Example
Using a Model with ViewBag
Controller Using Model and ViewBag
View Using Model and ViewBag
Using Model Directly
A View Using Model in Visual Studio
View Created by Visual Studio
Passing Parameters in Query String
Lab
Summary
Chapter 3: ASPNET MVC Architecture
The Controller in ASPNET MVC
The View in ASPNET MVC
The Model in ASPNET MVC
How MVC Works
Using Forms
HTML Helper Function
Handling Form Submission
Model Binding
Greet View
Input Validation
Nullable Type
Checking Model Validity
Validation Summary
Lab
Summary
Chapter 4: The Model
Microsoft Technologies for the Model
SmallPub Database
ADONET
Language Integrated Query (LINQ)
ADONET Entity Framework
EDM Example
SmallPub Tables
SmallPub Entity Data Model
Entity Data Model Concepts
Querying the EDM
Context Class
List of Categories
List of Books
LINQ to Entities Demo
A LINQ Query
IntelliSense
Controller
Using a Parameter
Modifying a Data Source
LINQ to Entities Insert Example
LINQ to Entities Delete Example
Entity Framework in a Class Library
Data Access Class Library
Console Client Code
Configuration in Entity Framework
Lab
ASPNET MVC Database Clients
ASPNET MVC CRUD Demo
NuGet Package Manager
Entity Framework via NuGet
Summary
Chapter 5: The Controller
IController Interface
A Low Level Controller
Displaying Context
Add and Subtract
Controller Base Class
Controller Base Class
Action Methods
Action Method Example
HomeController
MathController
Invoking MathController
Receiving Input
Binding Example
Non-Nullable Parameters
Nullable Parameters
Using a Model
Action Results
Action Result Example
Output Demo
JavaScript Object Notation
Action Method Attributes
HTML Output
Filters
Asynchronous Controllers
Lab
Summary
Chapter 6: The View
View Responsibility
A Program without a View
A Program with a View
View Page
Passing Data to the View
Dynamic and ExpandoObject
Passing Lists to the View
HTML Helper Methods
Link-Building Helpers
Form Helpers
Html Helper Example
Validation Helpers
Templated Helpers
Validation in Model
Validation in Controller
ValidationMessage Helper
Running the Example
Lab
Summary
Chapter 7: Routing
ASPNET Routing
Routing in ASPNET MVC
RouteCollectionExtensions Class
Simple Route Example
Default Values for URL Parameters
Using a Default Route
Home Controller
Assigning Parameter Values
Controller Code
View Code
Running the Example
Properties of Routes
UrlParameterOptional
Matching URLs to Route
Demo: Route Order
Install Route Debugging Utility
Multiple Matches
Fixing the Bug
Debugging Routes: Summary
Areas
Demo: Areas
Summary
Chapter 8: Unit Testing
Test-Driven Development
Functional Tests
Unit Tests
Test Automation
Refactoring
Regression Testing
Unit Testing in ASPNET MVC
Creating a Test Project
Adding a Unit Test Project
MVC Unit Test Example
A Test Class Library
The Model
Testing the Model
Structure of Unit Tests
Assertions
Visual Studio Unit Framework
Assert Class
AssertAreEqual()
More Assert Methods
CollectionAssert Class
StringAssert Class
Test Case
Test Methods
Test Class
Test Runner
More Tests
Ignoring Tests
Fixing the Bug
Testing Controllers
Classes with External Dependencies
Dependency Injection
Mocking Frameworks
Using Moq
Installing Moq Using NuGet
MvcMortgage Example
Models
Controller
Index View
Monthly Payment View
Unit Tests
Inversion of Control (IoC) Containers
Lab
Summary
Chapter 9: Security
Web Security
Input Forgery
Cross-Site Scripting
Cross-Site Scripting Example
Session Hijacking
Cross-Site Request Forgery
XSRF Example
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
Summary
Chapter 10 Combining ASPNET MVC and Web Forms
Using Web Forms in an MVC Application
Linking and Redirecting from Web Forms Pages to MVC Actions
Defaultaspx
Web Forms in MVC Example
Sharing Data between ASPNET MVC and ASPNET Web Forms
Using Web Form Controls in MVC Views
Web Forms MVC Interop in VS
Summary
Chapter 11: ASPNET Web API
ASPNET Web API
REST
Representation, State and Transfer
Collections and Elements
Web API Demo
Specifying a Start Page
Implementing PUT Verb
Using Fiddler
Composing a Request
ASPNET MVC and Web API
String API Demo
Route Registration
LabA
HTTP Response Codes
POST Response Code
HttpResponseException
Web API Clients
HttpClient
Initializing HttpClient
Issuing a GET Request
Issuing a POST Request
LabB
Summary
Chapter 12: ASPNET and Azure
What Is Windows Azure?
A Windows Azure Testbed
Windows Azure Demo
Publish to Azure
Modifying a Web Application
Deploy to Original Site
Lab
Summary
Appendix A: Learning Resources
Appendix B: Deployment in IIS
Internet Information Services
Installing IIS
MVC with IIS
NET Framework Version
Registering ASPNET
Demo: Running an MVC App on IIS
Convert to an Application
|
Course Directory [training on all levels]
- .NET Classes
- Agile/Scrum Classes
- Ajax Classes
- Android and iPhone Programming Classes
- Blaze Advisor Classes
- C Programming Classes
- C# Programming Classes
- C++ Programming Classes
- Cisco Classes
- Cloud Classes
- CompTIA Classes
- Crystal Reports Classes
- Design Patterns Classes
- DevOps Classes
- Foundations of Web Design & Web Authoring Classes
- Git, Jira, Wicket, Gradle, Tableau Classes
- IBM Classes
- Java Programming Classes
- JBoss Administration Classes
- JUnit, TDD, CPTC, Web Penetration Classes
- Linux Unix Classes
- Machine Learning Classes
- Microsoft Classes
- Microsoft Development Classes
- Microsoft SQL Server Classes
- Microsoft Team Foundation Server Classes
- Microsoft Windows Server Classes
- Oracle, MySQL, Cassandra, Hadoop Database Classes
- Perl Programming Classes
- Python Programming Classes
- Ruby Programming Classes
- Security Classes
- SharePoint Classes
- SOA Classes
- Tcl, Awk, Bash, Shell Classes
- UML Classes
- VMWare Classes
- Web Development Classes
- Web Services Classes
- Weblogic Administration Classes
- XML Classes
- Ruby on Rails
5 December, 2024 - 6 December, 2024 - Linux Fundaments GL120
9 December, 2024 - 13 December, 2024 - RED HAT ENTERPRISE LINUX AUTOMATION WITH ANSIBLE
2 December, 2024 - 5 December, 2024 - Introduction to Spring 5 (2022)
16 December, 2024 - 18 December, 2024 - Fast Track to Java 17 and OO Development
9 December, 2024 - 13 December, 2024 - See our complete public course listing