
Build RESTful web APIs with ASP.NET Core 5.0 and Entity Framework Core, and learn to consume them in Angular using Identity Core with JWT.
Learn why a Web API is needed to centralize data access across website, iOS, and Android apps, preventing duplicate business logic and simplifying maintenance.
Learn how a central web api mediates communication between multiple apps and a database, preventing direct access, enabling abstraction, avoiding duplicate logic, and ensuring secure, extensible integration.
Understand that a web api is a concept, not a technology, and learn how it uses http to extend an application's functionality and enable reuse across web and mobile projects.
Define REST as a set of principles for building RESTful web APIs, not a framework, applicable with Node.js, Java, or .NET, covering URL structure, HTTP verbs, status codes, and statelessness.
Understand how http, the hypertext transfer protocol, enables client-server communication through requests and responses. See how browsers and apps act as clients in a distributed web system.
Explore the core components of HTTP requests, including URL, method, headers, and body, and learn how HTTP responses use status codes, headers, and data to communicate between client and server.
Explore http verbs and methods, including get, post, put, patch, and delete, and learn when to create, update all or partial properties, or perform soft and hard deletes.
Explore HTTP status codes and their five categories, including 1xx informational, 2xx successful, 3xx redirection, 4xx client errors, and 5xx server errors, and understand how server responses convey this information.
Explore frequently used status codes in Web API, including 200 (OK), 201, 204, 301, 302, 400, 401, 404, 405, 500, and 503, with explanations of success and error scenarios.
Demonstrate an http request and response using a browser’s network tool, inspect request details, status code 200, headers, and view source and response data in a Web API context.
Identify and install the essential software for ASP.NET core web API development, including the operating system, the latest code sdk, an editor, and SQL Server Management Studio for the database.
Install the dotnet sdk for Windows, Linux, or macOS, understand sdk versus runtime, and verify the installation with a command to display sdk details.
Install Visual Studio 2019 or Visual Studio Code, choosing among community, professional, or enterprise editions on Windows, Mac, or Linux, and explore code editors, project setup, and repository cloning.
Install the SQL Server and set up a database for your ASP.NET Core Web API, explore on-premises or cloud options, and understand DBMS and table-based data storage.
Install and connect to SQL Server Management Studio (SSMS) to manage your databases, using Windows authentication or server credentials, with options to access SQL Server through SSMS or Visual Studio.
Install Postman, the client tool for testing web APIs, and use its complete interface to easily test HTTP methods like GET, POST, PUT, and DELETE.
Create your first ASP.NET Core Web API project using the command line interface (CLI) or Visual Studio, then run, test the default app, and explore the generated files.
Open the asp.net core web api project in visual studio code, explore the default folders and files, and learn how to open, view, and build the solution.
Build the asp.net core web api project using the command line interface, using either the existing command prompt or a new terminal window to run dotnet build.
Run the default ASP.NET Core web API project using the dotnet CLI and view it locally at localhost with swagger UI to test the get endpoint.
Test default APIs with Swagger, browser, and Postman to send get, post, and other HTTP requests, and inspect responses, headers, and status codes.
Learn to create and run a new asp.net core web api project in Visual Studio 2019, configure authentication and open api support, build the solution, and test locally with postman.
Navigate the ASP.NET Core Web API project files, dependencies, and framework details from the default template, including controllers, startup configuration, environment settings, and model and data layer structure.
Explore the launchSettings.json file for ASP.NET Core Web API, show how to switch between IIS Express and Kestrel profiles, configure the environment, and auto-launch the browser during development.
Open and edit the csproj file to view the project sdk, target framework net 5.0, and the packages and item groups that define an ASP.NET Core Web API project.
Create a dotnet core console application in Visual Studio, then convert it into an ASP.NET Core Web API by configuring services and adapting the project for web execution.
Update the csproj file by removing the output type, adjusting the sdk, and setting the target framework to net core 3.1 for the API project.
Learn how to convert a project into a web api by using a default host builder, which enables dependency injection, configuration, logging, and directory settings.
Explore configuring the default web host builder to enable Kestrel, IIS integration, and startup setup, and learn how to wire the host into the main method and run the app.
Implement two startup methods, configure services and configure, to register services with dependency injection and configure the request pipeline based on the hosting environment.
Enable routing in an ASP.NET Core Web API, set a default route, and map a resource using endpoint mapping to expose browser-ready output.
Inject Web API services into the project with the AddControllers method, configuring services to enable Web API functionality and map output to controller endpoints.
Add a new api controller by creating a class that inherits from the controller base, naming it with the controller suffix, employee controller, and applying the api controller attribute.
Explore how middleware forms the request pipeline and guides a browser request to a controller. See how order, authentication, routing, and exception handling shape security and responses.
Discover how run finishes execution in a middleware pipeline, how next passes control along, how use inserts custom logic, and how map targets a specific area.
Demonstrate the Run() method in middleware by wiring a request delegate, writing to context.response, and observing how the request pipeline executes and terminates.
Explore how the use and next methods shape the request pipeline by passing context and next to subsequent middleware, controlling message flow and execution order.
Explore the map method in middleware to branch requests by matches, executing the matched branch and ignoring non-matches. Add a custom map branch with use to trigger separate branch execution.
Create a custom middleware in a separate file for an ASP.NET Core 5.0 web API. Inject services via configure services and wire the middleware into the request pipeline.
Examine how the next method is invoked in ASP.NET Core middleware and verify endpoint routing in an open source repository.
Explore how routing in asp.net core web api maps incoming requests to controllers and resources, using a routing table to resolve exact matches and avoid ambiguity.
Enable routing in an ASP.NET Core web API by inserting routing middleware into the pipeline, mapping endpoints, and choosing between conventional and attribute routing to connect requests to controllers.
Learn how to set the first route on a controller action in ASP.NET Core, create an empty controller with scaffolding, apply HTTP route attributes, and expose basic get endpoints.
Learn how to map dynamic values in routing by defining path parameters with curly braces, using route attributes, and handling multiple variables in an ASP.NET Core Web API.
Explore passing data with the query string in routing by defining parameter names and values, using a leading question mark and ampersands, to enable parameter-based search.
Discover how to expose a single resource through multiple URLs using an action method, defining multiple route values (years), and retrieving output from the same resource while keeping identifiers unique.
Learn why a single url cannot map to multiple resources in ASP.NET Core Web API, causing a runtime ambiguity error, and how to resolve conflicting routes for correct resource resolution.
Explore token replacement in ASP.NET Core routing, where token values substitute controller and action names dynamically, enabling areas and unique, customizable route templates for multiple resources.
Define a base route at the controller level to share common code across all actions, then override routes as needed and test parameterized endpoints in an ASP.NET Core Web API.
Learn to enforce route constraints in an ASP.NET Core Web API by defining parameter types and applying minimum and maximum values, minimum length, maximum length, exact length, and range validations.
Explore route constraints by validating inputs with alpha and regex patterns, ensuring first name and last name contain only letters, combining with length checks and expression-based validations.
Learn best practices for RESTful URLs in CRUD operations, using plural resources like /employees and nested paths such as /employees/{id}/accounts to design clear, versioned APIs.
Explore how to use primitive and complex data types in an ASP.NET Core Web API by modeling an employee class, organizing models in folders, and returning lists with asynchronous methods.
Explore how IActionResult enables returning multiple data types in ASP.NET Core Web API, including OK and error results, and understand the trade-offs with Swagger and explicit type annotations.
Explore how ActionResult<T> enables returning different data types in an ASP.NET Core Web API. Return an employee model or basic details directly.
ASP.NET Core Web API is the latest and most powerful framework for the development of RESTful Web API. This Asp.Net Core Web API is open source and supported by Microsoft.
RESTful Web APIs are the most essentials part of any modern world application. These RESTful Web APIs help us to extend our application on multiple platforms like Web app, Android app, iOS app, etc.
Learning Journey
We will start our learning from the fundamentals of Web API like
What is Web API?
Why do we need Web API for our application?
What is the best framework for Web API development?
How to set up the development Machine?
Develop Web API in Real-world Book Store application
Consume the APIs in Angular Application.
How to work with Entity Framework Core 5.0 Code first approach?
How to create Login and Signup tables automatically using Identity Core?
And lots of other concepts.
What type of APIs we will develop
We will develop the following types of APIs
HTTP GET: Get single and multiple resources from the database
HTTP POST: Add a new resource (book) to the database
HTTP PUT: 2 ways to update all columns of a resource in the database
HTTP PATCH: Update only a few columns of a resource (Excellent explanation)
HTTP DELETE: Delete a resource from the database
Tools and technologies used in this RESTful Web APIs using Asp.Net Core 5.0
We will use all the latest tools and technologies for the development of RESTful Web APIs using Asp.Net Core.
Asp.Net Core 5.0
Entity Framework Core 5.0
Identity Core 5.0
SQL Server
JWT
C#
JSON format output
Postman (Web API testing client tool)
Visual Studio 2019
Visual Studio Code
SQL Server Management Studio
A couple of other packages that are required to develop reliable and robust Web APIs
Code Exercise file
You will get the entire code that is used in this tutorial in the Course resources lecture.