.NET

C#, dotNet Core, ASP.NET, Entity Framework, testing, architecture, and everything .NET developers need.

Creating and Consuming REST APIs

API basics with ASP.NET Core and C# clients

REST APIs let applications communicate over HTTP. In .NET, you can both build APIs (servers) and consume them (clients). πŸ› οΈ Creating a REST API (ASP.NET Core) Create a project: 1 2 dotnet ...

Building RESTful APIs with C#

Your first web API with ASP.NET Core

ASP.NET Core makes building RESTful web APIs easy! πŸš€ Getting Started Create a new project: 1 2 dotnet new webapi -n MyApi cd MyApi Run your API: 1 dotnet run Visit h...

Handling Async Errors

Catching exceptions in asynchronous code

Async methods can throw exceptions, just like normal ones. Handle them with try/catch! πŸ›‘ Catching Exceptions in Async Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 async Task FailAsync() { a...

Awaiting Tasks and Methods

Wait for things to finish, the async way

C# uses Task and async/await to run code asynchronously (in the background). πŸƒβ€β™‚οΈ Awaiting a Task 1 2 3 4 5 async Task RunAsync() { await Task.Delay(1000); // Wait 1 second Console.WriteL...

Introduction to Entity Framework

Easier database access with EF Core

Entity Framework Core (EF Core) is a modern ORM for C#. It lets you use C# classes to interact with your database: no raw SQL needed for most tasks! πŸš€ Why Use EF Core? Write less data access c...

Introduction to Async Programming

Make your programs faster and more responsive

Async programming lets your program do more than one thing at once: great for web requests, file I/O, and keeping apps fast. 🚦 Why Use Async? Don’t block the program while waiting for slow thi...

Executing SQL Commands: SELECT, INSERT, UPDATE, DELETE

CRUD operations with ADO.NET

ADO.NET lets you run any SQL against your database. Here’s how to do basic CRUD (Create, Read, Update, Delete). πŸ” SELECT (Read Data) 1 2 3 4 5 6 7 string sql = "SELECT Id, Name FROM Users"; using...

Connecting to SQL Server and Oracle

ADO.NET connections for major databases

ADO.NET supports many relational databases, including SQL Server and Oracle. πŸ—„οΈ SQL Server Connection Namespace: System.Data.SqlClient NuGet: Usually built-in 1 2 3 4 5 6 string connString...

LINQ with Objects

Query your own custom classes

You can use LINQ on any collection, including lists of your own classes. 🏫 Example: Students 1 2 3 4 5 6 7 8 9 10 11 class Student { public string Name; public int Age; } var students = n...

Aggregation and Grouping with LINQ

Summarize and organize your data

LINQ can do more than filter and sort: it can summarize and group your data. βž• Aggregation: Sum, Count, Average, Min, Max 1 2 3 4 5 6 int[] numbers = { 1, 2, 3, 4, 5 }; int sum = numbers.Sum(); ...