.NET Core
The course begins with a general introduction to the architecture of .NET Core, and the tools and deployment options for building any type of application.
- What is .NET Core and why write applications for it
- How to use both the command line and Visual Studio to develop for .NET Core
- The deployment options for a .NET Core application
ASP.NET Core
Web development requires a thorough understanding of ASP.NET Core, and this module covers the anatomy of an ASP.NET core application.
- Architecture of ASP.NET Core
- Startup and middleware
ASP.NET Core Web API
This module introduces Web API, the de facto framework for building HTTP-based RESTful services. We will cover the motivation for HTTP oriented services as an alternative to SOAP-based services. We will examine the architecture of an ASP.NET Core Web API application, including attribute and convention based routing, and discuss the new features introduced in ASP.Net Core 2.1, the APIControllerAttribute and the ActionResult<T> return type.
- REST Basics
- Web API controllers
- Web API action methods: returning a specific type, IActionResult, and ActionResult<T>
- Web API routing
- The new APIControllerAttribute
- CRUD operations
- .NET Web API Client
Repository and Unit of Work Patterns
Data access technologies have their own specific APIs. Writing application logic against these APIs is a form of corruption – you are now wedded to that data access technology. In addition, testing the application logic in isolation from the data store becomes difficult. The Repository and Unit of Work Patterns isolate your application from the underlying data store by abstracting away its details.
- How to separate application logic from data access
Dependency Injection
Tightly coupled systems are less flexible because they make it difficult to swap out components should they become outdated or should you wish to replace them. In addition, your code becomes less testable, because unit tests are unable to replace dependencies with fakes, turning unit tests into integration tests, which are slower and prone to breakage. You’ll learn how to address these issues with the ASP.NET Core built-in dependency injection container.
- Dependency Injection in ASP.NET Core
- Constructor and method injection
- Lifetime models: singleton vs. transient vs. scoped
- Creating services and injecting them into a web application
.NET Core Configuration
.NET Core configuration files operate differently from the traditional app.config and web.config files from .NET Framework. In a .NET Core application, configuration information is typically specified with json format using an appSettings.json file. This module demonstrates how configuration files are formatted and parsed in a .NET Core application.
- Initialization and retrieval from the .NET Core configuration file
- Binding and reloading
Mocking with Moq
In this session, we’ll introduce test doubles and show how mocking frameworks make it easier to stub out external dependencies. The details of Moq are presented, which is the de facto standard mocking framework for .NET Core.
- State vs Behavior verification
- The different forms of Test Doubles
- MOQ as an example of a mocking framework
- Stubs: Properties and Methods
- Mocks: Strict, Loose, and Partial
Unit Testing
Testing is a critical aspect of the software development process, and xUnit is the de facto testing framework for .NET Core. This module represents the culmination of the material covered in this course, by showing how to use xUnit to test an ASP.NET Core Web API Controller with mock data created using Moq.
- Using xUnit with Visual Studio
- xUnit and Moq
- Testing code that generates exceptions
- Testing an ASP.NET Core Controller
Tools
This module demonstrates how to use Visual Studio with Web Development tools.
Migration
This module discusses how to migrate an existing .NET application to .NET Core.
- Strategies and tools for porting an existing application
- Discontinued technologies in .NET Core
- Porting an ASP.NET Core Controller to .NET Core