
Learn to build an ASP.NET Core Web API from scratch using .NET 8, with restful patterns, Entity Framework, SQL Server, authentication, role-based authorization, fluent validation, asynchronous programming, and AutoMapper.
Ensure you have at least three months of experience with C# and ASP.NET Core or ASP.NET MVC, plus basic knowledge of APIs and the .NET ecosystem.
Identify and install the tools, languages, and frameworks needed to build a web API, including Visual Studio 2022, .NET Core SDK and Runtime, SQL Server, and SQL Server Management Studio.
Download and install Visual Studio 2022, selecting the community edition for Windows, then choose the ASP.NET and web development workload with .NET development and data storage options for SQL Server.
Follow the entire video to avoid missing key information and errors, and seek online help from Stack Overflow or other developers when needed.
Create a new asp.net core web api in visual studio using the rest template, configuring NZ walks with dotnet eight and authentication set to none.
Explore REST architecture and the resource-based design of web services, using URIs and HTTP verbs (GET, POST, PUT, DELETE) to perform actions in a stateless client-server model with ASP.NET Core.
Explore routing in ASP.NET Core web APIs by mapping incoming requests to the correct controller and action, then delete a product via the HTTP delete attribute using the URL ID.
Run and test an ASP.NET Core Web API with Swagger to explore endpoints like weather forecast and a students controller, then verify responses with Swagger or Postman.
Create domain models for difficulty, region, and work, with non-nullable ids and names, a nullable region image URL, and entity framework core navigation properties linking difficulty and region.
Create and configure a DbContext in ASP.NET Core with Entity Framework Core, defining DbSet properties for difficulty, region, and walk to map domain models to database tables.
Create a connection string in appsettings.json to connect to a SQL Server database with Entity Framework Core, naming it NZ Walks Connection string and including server, database, and trust settings.
Learn how dependency injection in ASP.NET Core uses a built-in container to inject the NZ Walks DbContext via Program.cs, wiring the SQL Server connection string from appsettings.json.
Create endpoints for an ASP.NET Core Web API by building controllers and action methods to perform CRUD operations on the region table.
Create a regions controller in an ASP.NET Core API to perform CRUD operations on the region domain model, exposing routes under api/regions and testing with swagger.
Create a get region by id action in a .NET 8 web api. Retrieve the region by id from the route using dbcontext.find or firstOrDefault and return 200 or 404.
Explore the difference between DTOs and domain models, and learn to map them with Entity Framework Core, sending DTOs to clients for secure, efficient data transfer.
Convert api methods to return region dto objects by mapping domain models to dto. Decoupling the api view layer from domain models and returning dto improves clarity.
Implement a post action to create a region using add region request dto, map to the domain model, save with DbContext, and return 201 created with a location header.
Update the region via a put endpoint using the id from the route and an update region DTO. Save changes using DbContext and return the updated region DTO.
Implement a delete region method in a .NET8 web API using http delete, route by id, validate existence with the dbcontext, delete, save changes, and return 200 or 404.
Learn asynchronous programming, convert controller methods to async, implement the repository pattern with repositories, and use Automapper for object-to-object mappings.
Learn how the repository pattern decouples data access from the application in asp.net core, using an abstraction layer and a standard interface for CRUD operations.
Implement get by id, create async, update async, and delete async methods in the region repository, refactor the controller to use the repository, and perform asynchronous CRUD operations.
Create a post endpoint at api/walks to add new walks using an add walk request DTO, automapper, and a repository with a db context.
Implement a get all action in the walks controller to retrieve all walks via the repository, map domain models to DTOs with AutoMapper, and return a 200 ok response.
Learn how entity framework core navigation properties fetch related data for walks, regions, and difficulties using include, with DTO mappings and repository patterns.
Implement an asynchronous get-by-id action in the walks controller, retrieving the walk by id with related difficulty and region, mapping to a DTO, and returning 404 if not found.
Update a walk by id with a put request to api/walks/{id}, using an update walk request DTO mapped to the domain model, then return the updated walk or not found.
Implement delete operation for the walks API: add repository delete async, remove by id, save changes, and return 200 with deleted walk DTO or 404 if not found.
Apply model validations in your ASP.NET Core Web API to ensure incoming data is valid for add, update, and delete operations, returning http 400 for invalid requests.
Apply data annotations to region and VOC request DTOs to enforce model validations on endpoints. Use ModelState to validate create and update requests and return bad requests when data fails.
Create a custom validate model attribute with an action filter to centralize model state checks. It automatically returns a 400 bad request when models are invalid, keeping controllers reusable.
Learn to filter and sort results in your ASP.NET Core Web API and implement pagination to enable efficient data navigation.
Seed a SQL Server database by running a script from the notes that deletes existing data and inserts rows into regions, difficulties, and walks tables in networks DB.
Demonstrates filtering in an asp.net core web api with query parameters to filter by name on the get all works endpoint, through controller and repository changes.
Implement pagination in an ASP.NET Core Web API using page number and page size query parameters. Apply skip and take logic after filtering and sorting to return scalable, client-friendly data.
Understand the authentication flow: the server creates and passes a JWT token to the client, which uses it to access the API and the API validates it.
Set up authentication in an ASP.NET Core Web API by installing JWT bearer NuGet packages, configuring JWT settings in appsettings.json, and implementing authentication and token validation in Program.cs.
Seed identity roles using OnModelCreating to inject reader and writer roles into the database. Configure two IdentityRole entries with IDs and concurrency stamps, then apply migrations to seed data.
Set up identity in your ASP.NET Core Web API by configuring identity core, adding roles and token providers, wiring the entity framework stores, and enabling JWT authentication.
Create an auth controller with a post register method at /api/auth/register, using a register request DTO and UserManager to create an IdentityUser in ASP.NET Core identity and assign roles.
Learn how to add JWT bearer authorization to Swagger, configure security definitions and header authentication, and test protected endpoints.
Learn to upload images through an asp.net core web api, validate extensions and size, store files locally, save image data in a database, and return the image path.
Create an image upload controller with a post method at api/images/upload, using an image upload DTO, validating extension and size, and saving the file and record via a repository.
Implement a local image repository to upload images via the ASP.NET Core Web API, convert the DTO to a domain model, and save the image and URL to the database.
Enable static files serving in asp.net core by configuring UseStaticFiles with a physical file provider and the /images path, so uploaded images in the images folder become accessible via /images.
Implement logging in our ASP.NET Core Web API using Serilog, a third-party library, to capture and store runtime information and insights into application behavior.
install Serilog packages, configure Serilog in Program.cs, inject the logger into the Regions controller, and log information, debug, warnings, errors, and exceptions to the console.
Implement a global exception handling middleware in an ASP.NET Core Web API to return a consistent 500 JSON error response, log the error, and include a unique error id.
*** NEW RECORDED VERSION on .NET 10 COMING SOON ***
THIS COURSE HAS BEEN UPDATED TO THE LATEST VERSION [.NET8]
The course is compatible with both versions - .NET7 & .NET8
This is a complete guide to creating ASP.NET Core Web API using .NET8, Entity Framework Core (EF Core), and SQL Server database.
With over 11000 student enrolments and more than 2000 5-star reviews, this course has helped students from all backgrounds to learn and implement ASP.NET core Web API.
This course is for all skill levels and best suits beginners and intermediate developers who have gained knowledge in C# and ASP.NET Web MVC and want to use their skills to learn ASP.NET Core and specifically ASP.NET Core Web API.
In this ASP.NET Core WEB API course, we will use .NET8 and create a REST WEB API.
During this course, you will gain so much experience creating ASP.NET Core APIs and endpoints and by the end, I am confident that you will gain enough practical knowledge to create your own ASP.NET Web APIs.
We will create a very engaging Web API in which we will create the regions and walks of New Zealand and we will create an ASP.NET Core Web API so that clients of this API can consume this data.
We will start with learning what are the principles of REST and understand the files that ASP.NET Core creates as part of a new project.
Then we will create and understand our domain and domain models.
Then we will go ahead and install Entity Framework Core and using EF Core migrations we will create our SQL Server Database.
We will then create controllers for our API and test them using Swagger UI.
We will also understand and implement the concepts of Domain and Data models and use clean coding techniques to build our ASP.NET CORE Web API.
We will use a famous third-party library called Automapper to map objects inside our API.
With all of this, we will go on and create CRUD operations for our Web API. We will perform Create, Read, Update, and Delete operations on our API using the Repository Pattern in ASP.NET Core API.
Then we will understand and implement Authentication and Authorization in ASP.NET CORE Web APIS using JWT tokens and see how we can generate JWT tokens using our API (Server) so that we can Authenticate and Authorize the clients of our application.
We will learn more advanced level stuff by implementing Filtering, Sorting, and Pagination in our ASP.NET Core Web API.
We will use Postman and Swagger to test our Authentication and Authorization.
We will also use ASP.NET Core Identity in our API where we Register users and assign roles to them.
In this course ASP.NET Core Web API course, you will learn and implement:
Understand REST APIs by creating a Web API using ASP.NET Core and .NET 7
Understand REST Principles
Understand Dependency Injection and Benefits
Creating New ASP.NET Core Web API Project
Understand .NET8 WEB API Project In .NET 8 and C#
Learn And Install Entity Framework Core (EF Core) In ASP.NET Core Web API Project
Learn Entity Framework Core Migrations
Understand the difference between Domain models and DTOs
Understand Domain Models and Repository Pattern
Use Swagger To Test ASPNET Core WEB API project
Learn How To Map Models To One Another Using Automapper
Learn Asynchronous Programming (Async Await)
Validate ASP.NET Core WEB API
Secure your ASP.NET Core Web API using Microsoft Identity by adding Authentication and Role-Based Authorization to your REST API.
Add JWT Authentication to ASP.NET Core Web API by creating JWT Tokens for API Clients.
Understand and Add Authentication and Authorization To ASP.NET Core API and Create Read and Write Users To Test this Via Postman
Incorporate ASP.NET JWT Authentication Into SwaggerUI
Add advanced functionality like Filtering, Sorting, and Pagination to your ASP.NET Core Web API.
Know me more
I am Sameer, a professional software developer with over 15 years of industry experience. I love to educate myself and others and that's why I started with my YouTube channel where I have a loving audience. I create content for software developers like you so that I can share my knowledge.
Statistics
Over 27000 students on Udemy
Over 4000 Reviews on Udemy
Over 2.4 Million Views on YouTube
Some of the reviews
Hands down the best way to learn this technology stack. Sameer did a good job here and I hope he will be blessing us with more interesting Angular projects in the future! Maybe a sample e-commerce or Hotel Booking app :)
Although I didn't have any prior experience with C# OR .Net Core MVC, I was still able to grasp a lot from this course, all thanks to the instructor!
A very detailed and extensive course! clear voice and great detail to topics.
and 1000s of more reviews on my courses.
Money Back Guarantee
I Guarantee you that after finishing this course, you will be confident enough to create REST APIs in ASP.NET Core and .NET8 on your own.
You will feel confident at work or when creating your projects.
If you want to create functional, generic, clean, and usable websites using ASP.NET, then this is the course for you.
If still, you are unable to get benefit from this course (we will be sad to see you go!), there is a "30-day money back guaranteed by Udemy".
Why do you need this course?
By buying this course, you will make a fantastic choice as this course will help you gain the confidence you need to create ASP.NET Core Web APIs
I assure you that by the end of this course, you will have the confidence to create scalable ASP.NET Core Web APIs from scratch.