
Learn RESTful API development with ASP.NET Core Web API through a bootcamp. Build an API, integrate with SQL Server, implement basic, OAuth, and role-based authentication, and deploy to Azure.
Prepare for the bootcamp by setting up Windows 10, an i5 or i7 processor, 8 GB RAM, Visual Studio 2019, SQL Server 2017+, and an Azure account with internet access.
Create a hello world web API with ASP.NET Core in Visual Studio 2019, using a new .NET Core web API project and HTTP GET, POST, and DELETE endpoints.
Create a minimal API with ASP.NET Core 2.0 in Visual Studio 2022, handling post requests and query parameters, supporting optional parameters, and integrating dependency injection for extensibility.
Create a new minimal API project in Visual Studio 2022 using templates, target dotnet 6.0, and run Hello World to see a simple request and response.
Build a minimal api to handle get, post, put, and delete requests, then test with Postman, including certificate handling and upload scenarios.
Learn to handle route parameters in ASP.NET Core Web API by mapping values to action parameters, including department id and employee id with int or string types, and test project.
Explore making route or query parameters optional in a minimal API within ASP.NET Core, using question marks to denote optional ids, and handle null results when omitted.
Explore handling query strings in a minimal API within a RESTful ASP.NET Core Web API bootcamp, using optional product and product id parameters to shape requests.
Explore building swagger for a REST API in a minimal API project, enabling swagger, using API Explorer, and customizing open API documentation with Swagger UI.
Build a calculator service with a dependency injection container in minimal api by registering an interface and its concrete implementation, then resolve it in endpoints to perform a and b.
Build a calculator API with add, subtract, and multiply using ASP.NET Core Web API and Visual Studio 2019, with JSON data exchange and a simple HTML5 jQuery client.
Develop a simple calculator api by creating an ASP.NET Core web app, defining a numeric domain with numA and numB, and implementing post actions for add, subtract, and multiply.
Test and build the calculator RESTful API, verify errors, use Postman with headers content-type application/json to send numberA and numberB, and view the server response.
Create a client app with HTML, Bootstrap, and jQuery, set up wwwroot, configure Startup.cs with app.UseStaticFiles, add test.html, run in a browser, and consume the API from HTML.
Consume the calculator RESTful API from an HTML app, with a UI for numberA and numberB, three action buttons, and display the result using JSON.stringify and Bootstrap/jQuery.
Develop a registration API with ASP.NET Core Web API and EF Core on SQL Server, exposing register and get all endpoints, with an HTML5/jQuery client using JSON and Postman tests.
Create a SQL server database RegDB, build a Members table with six columns, set primary key and identity, create a login with db_owner, and verify the connection for the app.
Set up a new ASP.NET Core web API project in Visual Studio, name the project and solution (RegistrationAPI/RegistrationApp), choose no authentication, and build the project with Entity Framework Core.
Install Entity Framework Core via NuGet in Visual Studio for SQL Server, scaffold DbContext with a connection string, generate models and context, and configure EF Core in the project.
Configure entity framework core by setting up startup.cs, registering configuration services, and defining the RegDBContext in appsettings.json to enable database access via a RESTful API.
Add a registration api controller, configure routing api/[controller]/[action], create a model and context, and verify database connectivity via a TestConnection get using Entity Framework Core.
Build a registration API in ASP.NET Core by implementing a Register method with [HttpPost], binding FromBody, adding the member via Add and SaveChanges, and a GetAll [HttpGet] endpoint.
Create a client app using HTML files in wwwroot, including registration.html and members.html. Use jQuery, bootstrap, and AJAX to call the ASP.NET Core API and display data with DataTables.
Explore authentication and authorization concepts, including verifying who you are and what you are allowed to do, and learn to implement a rest api for these checks.
Add basic authentication to a restful ASP.NET Core Web API and configure an authentication handler. Test the secured endpoints with Postman while using Entity Framework Core to access SQL Server.
Prepare the bootcamp database by configuring the AuthUser and AuthUserRole tables for a REST api project, and test with user1 as a customer and user2 as customer and admin.
Create a new ASP.NET Core Web API project in Visual Studio 2019, name it basicauthapp, select the API project template, and prepare to develop your application.
Add entity framework core via NuGet, create database with scripts, define data model and database contexts, configure connection in appsettings.json, register context in startup, and implement a basic authentication handler.
Develop and configure a basic authentication handler in ASP.NET Core, implementing IUserService, authenticating against a database, creating claims and authentication tickets, and wiring with Startup.cs.
Create a GreetingController with basic authentication, enabling [Authorize()] and a basic scheme, expose a SayHello endpoint that returns Identity.Name, and compile to verify errors.
Run the project and test the API using Postman at /api/greeting. Authenticate with basic authentication in Postman, set the authorization header (base64 of user:password), and verify the 200 status response.
Extend a basic ASP.NET Core API with role-based authorization, using GetRolesByUsername and claims to restrict access to admin or customer endpoints and test with Postman.
Build oauth2 on asp.net core by implementing the RFC 6749 authorization framework with grant types, using IdentityServer to issue access tokens and protect resources tested with postman.
Develop a web API with OAuth2 authentication in ASP.NET Core, configure a database with Entity Framework Core, implement in the controller, build a front-end client, and test with Postman.
Prepare OAuthDB with AuthUser, AuthUserRole, and AuthUserProfile tables, using an auto-increment Id. Seed two users, user1 and user2, with islogged false and roles for testing (customer and admin).
Create a new API project in Visual Studio 2019, name the project OAuthApp, select the API project template, and click create to start developing programs.
Add Entity Framework Core to the project, scaffold the DbContext with a connection string from appsettings.json, and register the context in configuration services to enable OAuth integration.
Implement oauth in an asp.net core web api by adding identity server, configuring api resources and client, validating users via resource owner password, and wiring startup with signing credentials.
Add a test controller named GreetingController, set the route to /api/[controller]/[action], and secure it with [Authorize], retrieving the user name from the claim identity and returning 'Hello OAuth2'.
Test the project with Postman, obtain an access token from /connect/token, and use a bearer token to access the api, paving the way for role-based authentication with oauth2.
Demonstrates implementing OAuth2 with ASP.NET Core role-based authorization, storing user roles in a database, and enforcing [Authorize] role checks for sayall and sayadmin endpoints, tested via Postman.
Explore deploying an ASP.NET Core RESTful API to Microsoft Azure using web apps, illustrating three deployment scenarios: no database, SQL Server database, and OAuth2-enabled authentication with SQL Server.
Deploy a RESTful API built with ASP.NET Core to Azure, configure Azure SQL Database, set the connection in appsettings.json, publish using a profile, and test the API against the database.
Deploy a restful api built with ASP.NET Core to Azure, configure OAuth2 and SQL Server, publish, test with Postman, and troubleshoot signing credentials and token authorization.
Learn to implement JWT token authentication in a RESTful ASP.NET Core Web API by customizing OAuth2 tokens, securing a SQL Server user store, and testing token-based access with Postman.
Create a JwtDb database and a users table with username, password, fullName, email, and created; define username as primary key with auto increment and not null, for API and JWT.
Create a new ASP.NET Core web API project in Visual Studio 2019 using the 3.1 API template, name it JwtAPIApp, and review Startup.cs and Program.cs before configuring Entity Framework Core.
Install Microsoft.EntityFrameworkCore.Tools and Microsoft.EntityFrameworkCore.SqlServer via NuGet, then scaffold the context with Scaffold-DbContext. Register the database context in Startup.cs and move the connection string to appsettings.json.
Develop a JWT secured ASP.NET Core API by building register and login endpoints, generating tokens with JwtSecurityTokenHandler, and protecting actions with [Authorize] on a sample controller.
Build and test the project, run endpoints like /api/test/hello and /api/test/getmembership, observe unauthorized without a token, then register, login, and use a JWT token to access protected data.
This course is designed for every developer who wants to build RESTful API using ASP.NET Core. Course contents consists of three grades: Beginning (Level 100), Intermediate (Level 200) and Advanced (Level 300) so you can improve your development skill while learning this course. You can see a course grade on each section.
The course is intended to build RESTful API using ASP.NET Core with step-by-step approach. It's suitable for junior web developers and welcoming for senior web developers too. All project samples are written in C# so C# programming skills are required.
You will learn the following topics in this bootcamp:
Basic REST APIs programming using ASP.NET Core
Accessing database from ASP.NET Core REST API using .NET Entity Framework Core
Applying Authentication, Authorization and Role-Based Authorization
Implementing RESTful API Security with OAuth2
Implementing RESTful API Security with JWT Token
Deploying ASP.NET Core REST API to Microsoft Azure
Required Lab Environment
To perform this course, you should prepare these materials:
Computer with Windows 10 (Recommended), macOS (Optional) and Linux (Optional)
.NET Core SDK 2.2.x or later
Visual Studio 2019 or later. You can use Visual Studio Code with dotnet commandline
Active Azure account to deploy to Microsoft Azure
Please enjoy your course. Please let me if you have questions corresponding to this course.
Update 19 February 2022
Add new content about ASP.NET Core 6.0 API with Minimal APIs
Update 18 April 2020
Add new content about ASP.NET Core API with JWT token