Web APIs with .NET
This three-day, instructor-led course will prepare students to design, develop, and deliver HTTP-based APIs using Microsoft's ASP.NET MVC.
Prerequisites
This course is for software developers using C# and .NET to create APIs using ASP.NET MVC. It is expected the developers are proficient with C#, and have an understanding of DevOps practices like CI/CD, configuration management, and containers.
Objectives
The purpose of this course is to provide developers with the skills and knowledge to design, plan, create and deploy services that expose an HTTP interface using .NET. At the conclusion of this class, developers will be able to:
Understand HTTP APIs and the ASP.NET MVC Framework for Creating High-Performance Services
Developers will learn about the "sweet spot" for REST and RESTful APIs, how to properly implement resource-oriented architecture, proper use of the HTTP Verbs, as well as the limitations of APIs built with HTTP (and a presentation of alternatives, like gRPC).
Create a Variety Of API Implementations
Developers will understand the concept of HTTP Middleware, services, dependency injection, and service lifetime management. They will implement a full RESTful API using Controllers, as well as explore "minimal" APIs for Microservice functionality.
Utilize and Deploy The ASP.NET MVC Hosting Models
Including publishing APIs for use on a server, using the Kestral web server, and deploying APIs to container images. The primary focus of this class will assume deployment to containers, and we will learn how to set up a development environment to ensure our containized application performs well when moved to a production environment. We will run our services locally, and also learn how to deploy them in containers to an orchestrated environment (Kubernetes).
Troubleshooting and Debugging APIs
Including manual testing, testing and monitoring APIs running in a container, and instrumenting applications for logging. Basic automated testing will be introduced, and fully explored in the Developer Testing Services course. We will emphasize performance and design alternatives when synchronous "request/response" services won't meet our performance requirements. Developers will also learn to instrument and trace their application to determine "hot spots" for performance tuning and memory requirements and issues.
Calling Other APIs from Your API using the HttpClient
When deploying services as Microservices, your service will have to integrate with other services, often using HTTP. We will learn how to provide the
HttpClient
to our service classes in a way that will ensure proper, stable operation in production. We will also show techniques for dealing with transient network issues, and circuit breakers to make our services more resiliant and a "good neighbor" to the other services in our environment.
The ASP.NET Web API Configuration Model
Successfully configuring your application for secrets, environment variables, etc. is a key skill in successfully deploying APIs. We will explore the .NET Configuration story, how to "tweak" it for your work, and how to store the configuration with your source code safely.
Documenting Your API with OpenAPI Specifications and API Versioning
The OpenAPI Specification Format for documenting your APIs will be taught, along with "fine-tuning" your documentation to allow users to easily discover and use the API in a reliable manner. We will discuss strategies to version your API to minimize breaking clients, and take about what you might do when you have to.
Expected Outcome of this Training
At the conclusion of the Web APIs with .NET, developers will be able to:
- Correctly utilize HTTP-based APIs to provide business functionality.
- Utilize the ASP.NET Framework for developing a variety of HTTP-based services
- Develop services that run in a Cloud Native environment (inside containers)
- Troubleshoot, Debug, and Prevent common API issues, including performance issues and network reliability problems
- Document APIs with OpenAPI specifications and understand API versioning