
This video shows you how to follow along with the course using any version of .NET. We’ll go over small differences between .NET versions that might affect code examples and explain simple adjustments you can make. You’ll also learn easy tips for setting up your development environment to work with multiple versions if needed. By the end, you’ll feel ready to use the course material with whatever .NET version you have.
Introduction to ASP.NET Core Web API and its benefits for building scalable, RESTful services.
Step-by-step guide to installing the ASP.NET Core SDK and runtime, ensuring your environment is ready for development.
Walkthrough of creating a new Web API project in Visual Studio, covering project settings and structure.
Overview of the default files and folders in an ASP.NET Core Web API project, explaining their purposes.
The popularity of Postman is well deserved, as it delivers simple to complex features for everyday users to quickly test HTTP based requests.
Swagger offers tools to validate that your API works as it should, explore new API capabilities, and allows for seamless integration with automated API testing.
Recap of key concepts covered in this section to reinforce understanding.
Overview of the project and the steps involved in building a basic Web API with ASP.NET Core.
Introduction to creating a model for the Book entity, defining properties for storing book data.
Setting up Entity Framework Core's DbContext to manage database operations for the Book model. Key concepts to know:
DbContext is the most important Entity Framework class.
DbContext servers as a bridge between entity classes (C#) and database tables (SQL).
Generating and applying the first EF Core migration to create the database schema based on the Book model.
Populating the database with initial data to work with while developing and testing the API.
Implementing the POST method to allow users to add new books to the database via the API.
✅ HTTP (Hypertext Transfer Protocol) is a method for encoding and transporting information between a client and a web server
✅ [HttpGet] is used to get data from a server/database
✅ [HttpGet("{id}")] is used to get data from a Web API using a parameter that is passed with the request URL.
Implementing the PUT method to allow users to update details of an existing book in the database.
Implementing the DELETE method to remove a book from the database by ID.
Recap of the section and a review of all CRUD operations implemented in the Web API.
Introduction to relational data concepts in Entity Framework Core. Understand how to structure data relationships, manage data connections, and set up relational data in ASP.NET Core.
Discover how to establish many-to-many relationships, such as associating multiple Authors with multiple Books. Understand how to configure junction tables and set up efficient data navigation.
Learn how to add services for managing Author and Publisher entities in the API, establishing CRUD operations and integrating them with the Book model.
Implement the POST method for adding relational data, allowing users to link entities, such as adding an Author to a Book or assigning a Publisher to a Book.
Implement a GET method to retrieve a list of Authors associated with a Book, covering efficient querying techniques and managing multiple Authors per Book.
Learn to implement a GET method to fetch all Books related to a specific Author, demonstrating queries that utilize entity relationships in the API.
Extend the GET method to retrieve a list of Books from a specific Publisher, including each Book's associated Authors, showcasing advanced querying in Entity Framework.
Understand how to safely delete relational data, including handling cascading deletions and orphaned data in complex relationships.
Recap the relational data concepts covered, reinforcing knowledge of one-to-many and many-to-many relationships, CRUD operations, and data retrieval techniques.
Get an overview of error and exception handling in ASP.NET Core. Learn why handling errors effectively is essential.
Explore common HTTP status codes like 200, 400, 404, and 500. Learn the meanings and appropriate usage of each in API responses.
Discover the basics of error handling with try-catch-finally blocks. Learn how to manage exceptions and ensure resource cleanup in your code.
Learn how to create and throw custom exceptions to handle specific scenarios in your application, improving clarity in error handling.
Understand how to set up global error handling in ASP.NET Core, ensuring consistent responses for unhandled errors across your application.
Learn how to create custom middleware for error handling in ASP.NET Core. Discover how middleware can intercept requests, handle exceptions, log errors, and provide structured error responses across the application.
Review the error and exception handling techniques covered, reinforcing best practices and highlighting the importance of effective error management.
Overview of controller action return types in ASP.NET Core. Understand why selecting the appropriate return type matters for creating clear and effective API responses.
Learn how to use specific return types, such as string or int, in controller actions. Understand when to use these types and the benefits they offer in straightforward scenarios.
Discover the IActionResult interface, a flexible return type that allows you to return various HTTP status codes and content types, enhancing control over API responses.
Explore the ActionResult<Type> pattern, which combines strong typing with flexibility. Learn how to return both data and status codes for improved API readability.
Learn how to define custom return types tailored to your API’s needs. This lecture covers creating and using custom classes for structured and informative responses.
Recap the various controller action return types discussed, highlighting their uses, strengths, and best practices for selecting the right type in different scenarios.
Overview of sorting, filtering, and paging in ASP.NET Core. Understand why these features are essential for efficient data handling and how they improve the user experience in APIs.
Learn to implement server-side sorting, enabling API clients to sort data by specified fields. This lecture covers query parameters, sorting logic, and integration with your data layer.
Discover how to add filtering functionality on the server side, allowing clients to retrieve data based on specific criteria. Understand filtering patterns, query handling, and applying filters to improve data precision.
Implement server-side paging to limit the amount of data returned in a single request. This lecture covers the basics of pagination, configuring page size, and managing requests for large datasets efficiently.
Recap of sorting, filtering, and paging, reinforcing key concepts and best practices to improve API data handling and performance.
Introduction to the concept of API versioning. Understand why versioning is essential for maintaining backward compatibility and supporting evolving API functionality.
Learn the steps to set up versioning in an ASP.NET Core Web API project. Explore available tools and libraries that simplify implementing API versioning.
Discover how to implement query string-based versioning, allowing clients to specify the API version in the URL’s query string, a straightforward and client-friendly approach.
Implement URL-based versioning, where the API version is included as part of the URL path, making it clear and visible in the endpoint structure.
Explore header-based versioning, where the API version is provided in the HTTP headers, keeping the URL clean while still supporting versioned responses.
Learn how to use media type-based versioning, where clients specify the version in the Accept header, allowing for flexible version management based on content negotiation.
Recap of the different versioning strategies covered, emphasizing the pros and cons of each and guiding best practices for implementing versioning in APIs.
Understand the importance of logging in web applications. Learn what logging is, why it matters, and how it helps in monitoring and troubleshooting applications.
A deeper dive into the purpose of logging. Explore different types of logs, best practices, and how logging supports application maintenance and debugging.
Learn the steps to install and configure Serilog in an ASP.NET Core Web API project. Explore Serilog’s configuration options to customize logging behavior.
Set up Serilog to log messages to a file, allowing you to keep track of API activity in a persistent log file for future analysis.
Use Entity Framework Core migrations to add a new table for storing log data. Understand how to prepare your database for structured logging.
Configure Serilog to log directly to an SQL database table. Learn to store logs in a relational database, making them easy to query and analyze.
Implement functionality to retrieve and view logs stored in the database. Understand how to query and display logs to monitor application behavior over time.
Recap the logging techniques and tools covered, emphasizing best practices and the value of consistent logging for application management.
Blog URL: https://dotnethow.net/nunit-testing-framework/
A Web API is an application programming interface for the Web. With Web API, you get access to entire features of HTTP like URIs, request/response headers, content formatting, etc.
This course will teach you all you need to know to build personal or commercial applications using Asp.Net Core Web API as your development framework. You will start from just Visual Studio and build your app from the ground up.
As data storage, you will use an SQL database and Entity Framework will be used to interact with your data. You will also learn how to update database schema using Entity Framework migrations, how to add data to the database, get data from the database, update data in the database and also delete data from the database.
You will not only learn about the default features or capabilities that Asp.Net Core Web API has to offer, but you will also create your custom implementations like for example a custom Web API return type.
You will learn all these, step by step with hands-on practice. You will also have a lot of quizzes that will help to improve your knowledge of Web API.
Some of the topics that this course covers are:
Introduction to Web API
Building your first Asp.Net Core API
Working with relational data
Controller Action return types
Sorting, Filtering, and Paging
Asp.Net Core Web API Versioning
Unit Testing
and much more...
You can find the source code of this course on my Github account: @etrupja/complete-guide-to-aspnetcore-web-api