Learning Objectives: Input Validation and Data Protection What is Input Validation? Input validation ensures that user inputs are clean, safe, and valid before processing them. This is crucial to prevent security vulnerabilities like SQL Injection or Cross-Site Scripting (XSS). How to Implement Input Validation in ASP.NET Core: Example: Validating User Input: Real-Life Example: In a […]
Learning Objectives Asynchronous API Endpoints What are Asynchronous API Endpoints? Asynchronous programming allows you to handle requests without blocking the main thread. This is useful in scenarios where waiting for a response (e.g., reading from a database) could take time. In .NET Core, you use the async/await keywords to create asynchronous methods. Why Use Asynchronous […]
Learning Objectives Global Exception Handling What is Global Exception Handling? Global exception handling allows you to catch and handle errors that occur anywhere in your application. It is essential to prevent unexpected crashes and to ensure that the user receives meaningful error messages. In ASP.NET Core, you can implement global exception handling using middleware to […]
Learning Objectives 1. Authentication with JWT What is JWT? JWT (JSON Web Token) is a compact, URL-safe token format used to securely transmit information between parties. In the context of APIs, JWTs are commonly used for authentication by creating a token that users receive after successfully logging in. They include user information (claims) and are […]
Learning Objectives Unit Testing What is Unit Testing? Unit testing is the process of testing small, isolated pieces of code (units), such as methods in a class, to ensure they work as expected. The primary goal of unit testing is to verify that individual units of code function correctly in isolation. In ASP.NET Core, unit […]
Learning Objectives: RESTful Design What is REST? REST (Representational State Transfer) is an architectural style for designing networked applications. RESTful APIs use HTTP methods (GET, POST, PUT, DELETE) to manage resources and are easy to use, scalable, and widely adopted for web services. Key RESTful Concepts: Example of Resource URL: Example: Creating RESTful Endpoints: Real-Life […]
Learning Objectives ADO.NET Basics What is ADO.NET? ADO.NET is a data access technology that allows .NET applications to interact with databases. It provides the means to connect, execute commands, and retrieve results from databases such as SQL Server. Setting Up SQL Connection To connect to a SQL Server database, we need to use SqlConnection: Real-Life […]
What is Routing? Routing in ASP.NET Core is the process of mapping an incoming HTTP request to a particular controller action. When a request is made to an API, routing helps to determine which action should handle it based on the URL and other request parameters. There are two main types of routing: 1. IActionResult […]
Learning Objectives Creating Web APIs What is a Web API? A Web API (Application Programming Interface) allows different applications to communicate with each other over HTTP. In ASP.NET Core, Web APIs are built using controllers and actions to define endpoints, and attribute routing to manage how requests are directed. Controllers, Actions, and Attribute Routing Creating […]
Learning Objectives C# Version Updates Nullable Reference Types In earlier versions of C#, reference types could be null by default, often leading to runtime errors (null reference exceptions). Starting with C# 8, nullable reference types were introduced to provide better null safety. Code Example: Real-Life Example: In a user management system, ensuring fields like email […]