
Introduction to ASP.NET Core 2.2 web APIs, explaining service oriented architecture, hosting reusable services on separate servers, and RESTful web APIs built on dotnet core for cross-platform, HTTP-driven data exchange.
Create a simple web API from scratch with ASP.NET Core, host it on IIS or Kestrel, then consume it from a jQuery Ajax UI while configuring CORS and routing.
Explore how to get started with ASP.Net Core 3.1 Web APIs through three simple steps, note changes from 2.2, and update startup with add controllers, use routing, and map controllers.
Publish and host a .NET web api live on a subdomain via Visual Studio and FTP, with IIS settings, destination URL, and CORS-enabled UI calls.
Learn the http methods post, get, put, and delete for create, read, update, and delete operations on web APIs, and understand urls, uris, json data, and http headers for security.
Learn to build a data access layer with EF Core 2.2, implement CRUD via a DbContext and DbSet, and test a web API with fiddler using code-first migrations.
Create a web api that performs read operations with get methods, using dependency injection to supply the organization db context to a departments controller, returning departments as json.
Learn to create an ASP.NET Core 2.2 web API with post, put, and delete methods, test using Fiddler, and handle json payloads with content-type application/json and appropriate return messages.
Explore the HTTP request–response lifecycle in a web API, covering headers, body, and content types, and master common status codes like 200, 400, and 500 for CRUD operations.
Discover how Swagger UI and OpenAPI document and test a .NET core web API, install and configure Swagger, and explore a department controller with CRUD operations.
Leverage IActionResult for get operations by returning data alongside status codes or a not found response. Learn runtime polymorphism and the benefits of ActionResult over explicit data types.
Explore how to implement create with IActionResult and CreatedAtAction to return the new resource URL. Validate model state, return bad request on errors, and follow RESTful HTTP standards.
Enhance update operations in a put method by using IActionResult, handling not found and bad request scenarios, validating model state, and returning no content on success.
Check for the record, delete it if found, return not found if missing, and return no content on success (or the deleted record with department id and name via IActionResult).
Explore method overloading and action routing in ASP.NET core web APIs, implementing get by id, get by name, and multi-parameter queries with action names or query strings for clear routes.
Convert an API controller to asynchronous actions with async/await, adopt open API over swagger, and use eager loading to include departments with employees while reviewing JSON serialization and deserialization.
Learn how circular references between employees and departments cause infinite loops during serialization. Apply projection with selective fields to stop recursion, nullify nested lists, and shape results for mvc swagger.
This lecture presents the second approach to the circular reference problem by explicitly serializing objects to JSON using Newtonsoft.Json, ignoring reference loops, returning JSON results to the client.
Explore three approaches to exception handling in ASP.NET Core 2.2 web APIs: action-level try-catch returning status code 500, a global exception filter, and middleware using app.UseExceptionHandler.
Learn to return xml from ASP.NET Core web APIs by installing the Microsoft.AspNetCore.Mvc.Formatters.Xml package and enabling xml serializer formatters in startup, then apply produces application/xml on controllers.
Learn authentication and authorization basics for a web API, comparing cookie-based and token-based security with ASP.NET Identity (JWT), and implement initial setup by adding packages and enabling authentication.
Secure web apps by applying authorize at action, controller, or application level; configure cookies to return 401 instead of redirects for unauthorized API access.
Configure application cookies to return 401 on login redirects, then implement api registration using a register view model and identity's UserManager and SignInManager to create users via api/account/register.
Master cookie-based authentication in ASP.NET Core by implementing sign in and sign out, managing the identity cookie, and securing access with HTTPS, CORS, and credentials for client apps.
Implement role-based authorization by creating admin and user roles, assigning roles at registration, and securing admin-only controllers while tracking who created records with the logged-in user.
Explore principal identity roles and claims, and how JWT enables stateless authentication by encoding user identity, claims, and role in a token validated by middleware.
Add user id, username, and role as claims to a json web token during login, then sign and validate it with middleware to enable proper authorization.
Create and validate JSON web tokens (jwt) for authentication by generating signing keys, tokens with expiry, and enabling jwt bearer in middleware for bearer token requests.
Migrate an existing asp.net core 2.0 web api to 3.1 by updating the data access layer and identity packages, then generate migrations, update the database, and configure jwt and swagger.
[Updated With Latest Lecture On Migration from ASP.Net Core 2.0 Web API to ASP.Net Core 3.1 Web API]
Why ASP.Net Core Web APIs?
ASP.NET Core is OS neutral and integrates seamlessly with popular client-side frameworks and libraries, including Blazor, Angular, React, and Bootstrap. Millions of developers have used (and continue to use) ASP.NET 4.x to create web apps. ASP.NET Core is a redesign of ASP.NET 4.x, with architectural changes that result in a leaner, more modular framework.
ASP.NET Core Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Core Web API is an ideal platform for building RESTful applications.
HTTP is not just for serving up web pages. It is also a powerful platform for building APIs that expose services and data. HTTP is simple, flexible, and ubiquitous. Almost any platform that you can think of has an HTTP library, so HTTP services can reach a broad range of clients, including browsers, mobile devices, and traditional desktop applications.