
Learn web API in ASP.NET Core 5 through a real project and JSON data exchange. Explore server and client concepts, including DbContext, JWT, Swagger, repositories, and client-side token handling.
Open Visual Studio and create an ASP.NET Core Web API project named ServerSide with solution WEB-API, selecting .NET Core and ASP.NET Core 5, and disable HTTPS for a test project.
Explore startup configuration files such as StartUp and appsettings.json, adjust launchBrowser for IIS or self-hosted, and use swagger to document and test the WeatherForcast API via Get requests at localhost:5000.
Create an application user and identity tables in ASP.NET Core, configure ApplicationUser with first name and last name, register services, and apply migrations to a SQL Server database.
Seed a database in ASP.NET Core by creating initial data, such as an admin user and rules, then run and verify the seed in a real project.
Create project tables for a real web api by defining menu and news with keys and properties, then configure the context and migrations.
Explore the basics of api controllers in ASP.NET Core 5, distinguish API controllers, apply the API controller attribute, and test get, post, and put actions using a routing pattern api/controller.
Build and test a menu API in ASP.NET Core 5 by creating a menu API controller, wiring the application context, and implementing get, post, put, and delete endpoints with Postman.
Apply validation in web api using model-level attributes to enforce required fields and min and max length, validating requests and returning appropriate status codes like 200, 404, and 500.
Caching stores frequently used data in memory to speed up data retrieval and reduce server workload. It differentiates client, private, shared, proxy, and memory caches to optimize responses.
Learn to enable response caching in an ASP.NET Core controller with the ResponseCache attribute, caching responses for 60 seconds so subsequent requests are served from cache.
Implement memory caching in a real ASP.NET Core 5 web API by configuring, injecting, and using a memory cache with keys and sliding expiration to serve menu data.
Learn to implement the repository pattern in a real ASP.NET Core project by encapsulating data access, injecting repositories into controllers, and building menu data operations via interfaces.
Continue the repository pattern implementation by creating a news repository and service, wiring up the application context and memory cache, and exposing CRUD API endpoints through a news controller.
Upload images or files to an ASP.NET Core 5 web API by implementing a photo save workflow, creating directories as needed, updating the news repository, and testing with Postman.
Learn how paging limits API results to improve performance in a real asp.net core 5 project, using page-based requests and http headers to return total counts, while testing with Postman.
Configure JWT authentication in ASP.NET Core 5 by setting token validation parameters, signing key, and CORS options; test with Postman and plan login and register in the next session.
Create a register API in ASP.NET Core 5 by wiring a controller with sign-in manager and user manager, and define a virtual user model with email and password validation.
Develop a post login API in ASP.NET Core, validate user input (email and password), issue a signed credential token, and test access authorization via Postman.
Create a client-side project to enable the client to communicate with the server via the API. Implement key pages such as login, authentication, and pagination.
Create client repositories and models to fetch the menu from the server API, and implement an interface to retrieve menu data through the API with injected services.
Fetch news for the index page via an asp.net core 5 api, using a page parameter and reading the header for pagination while deserializing the response for the client.
Implement client-side paging on the front page by managing current page and total pages, using zero-based indexing, and refreshing the project for upcoming news detail.
Create a client-side request and a show-detail page to fetch news by id, update the API and repository, and render the news title and body.
Create a client-side register page that posts user email and password to the API account controller, validates input, handles responses, and confirms successful sign-up.
Implement authentication by saving the token for subsequent requests, with cookies configured in startup to enable login. Handle the server login flow through the account controller, returning user data and establishing identity via claims, principal, and authentication properties, then store cookies for accessing profile pages.
Create an admin area in the client to manage news menus and the database, securing pages with authentication and authorization policies to restrict access to index and manage pages.
Post data and files from a client to an asp.net core api via multipart form data to create menus in sql server, using authentication claims.
Fetches news from the API, deserializes it into a list, and binds it to a Razor page table showing title, category, truncated body, and image with delete and update actions.
Learn to update data and files on the server from a client via an ASP.NET Core Web API, including sending IDs, updating news entries, and implementing repository and authentication changes.
Delete data from a client to the server using an API in an ASP.NET Core web API project. Learn how to manage delete requests and responses between client and server.
Expose and document your ASP.NET Core web APIs using Swagger, generate XML comments, and test endpoints with Postman to boost API usability and developer collaboration.
In this tutorial, we will implement API related topics in .NET Core 5. We start the training with a real project that has a server and client-side. The two sections communicate via the API. In this tutorial, we will cover important issues and avoid issues that you know about.
On the Server-side, we implement the ApiConntrollers, methods such as Post, PUT, Get and Delete. We can also authenticate users using JWT (JSON WEB Token). We also implement how to save photos or files via the API. We will also implement things like Paging, Response, and Memory Caching, Validation, Repositories Login, and Register API. In addition, we can change the header for HTTP and put information that we use in the client section.
In contrast on the Client-side, we create a project with a news template. And we will receive and send information from the server through the API. To do this, we receive the token from the server at login time, then store it in the client and send it to the APIs along with the requests. Also, on the Client-side, we have a section for managing information, which is Authorized so that unauthorized users cannot manipulate the information. Finally, for all APIs, we use Swagger to create documentation that is important to developers.