.NET

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

Declaring and Using Generic Methods and Classes

Make your code flexible and reusable

Generics let you write methods and classes that work with any data type. 🛠️ Generic Method Example 1 2 3 4 5 6 T Echo<T>(T input) { return input; } Console.WriteLine(Echo(5)); // 5...

Generic Collections: List, Dictionary, Queue, Stack

Storing and working with groups of data

C# gives you powerful built-in collections to store groups of data. 📋 List A resizable list of items. 1 2 3 4 List<string> names = new List<string>(); names.Add("Alice"); names.Add("...

Working with Generics

Reusable and type-safe code

Generics allow you to write flexible, type-safe code. 📦 What are Generics? Let you create classes/methods that work with any data type. Example: List<T> can hold any type (List<int&...

Access Modifiers: public, private, and protected

Controlling access to your code

Access modifiers decide who can see and use parts of your code. public Anyone can access. 1 2 3 4 public class Car { public string Model; // Anyone can read/write Model } private Only the...

Encapsulation, Inheritance, and Polymorphism

The core of OOP in C#

C# is built on object-oriented programming (OOP), which is powered by three main ideas. 🔒 Encapsulation Keep data safe inside a class. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class BankAccount { pr...

Classes, Objects, and Methods

Building blocks of C# programs

Classes, objects, and methods are at the heart of C# programming. 🧱 Making a Class A class is a template for creating objects. 1 2 3 4 5 6 7 8 class Animal { public string Name; public v...

Object-Oriented Programming in C#

Understanding objects, classes, and OOP basics

C# is an object-oriented language. That means you build programs using classes and objects. 🏗️ What is a Class? A class is a blueprint for objects. 1 2 3 4 5 6 7 8 class Car { public string ...

Static vs. Instance Methods

How methods relate to objects and classes

In C#, methods can be static or instance. Knowing the difference helps you organize your code. 🏛️ Static Methods Belong to the class itself, not to any object. Call them using the class name...

Parameters and Return Values

How data moves in and out of your functions

Functions can take inputs (parameters) and give you results (return values). 📥 Parameters Parameters let you pass data into a function. 1 2 3 4 5 void Greet(string name) { Console.WriteLine(...

Declaring and Using Functions

Make your code reusable and organized

Functions (also called methods in C#) are essential for writing clean, reusable code. 🛠️ How to Declare a Function 1 2 3 4 int Add(int a, int b) { return a + b; } int: Return type (the fu...