.NET

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

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...

Methods and Functions

Organize your code with reusable blocks

Methods (also called functions) are reusable blocks of code. They help organize your program and avoid repetition. 🛠️ Defining a Method 1 2 3 4 void SayHello() { Console.WriteLine("Hello!"); ...

Using break, continue, and return

Controlling loops and methods

Sometimes you want to exit a loop early or skip certain steps. C# gives you keywords for this. ⏹️ break Ends the loop immediately. 1 2 3 4 5 6 for (int i = 1; i <= 10; i++) { if (i == 5) ...

Loops and Iteration: for, while, and foreach

Repeating actions in C#

Loops let your program do something over and over: great for processing lists or repeating tasks. 🔁 for Loop Count a known number of times: 1 2 3 4 for (int i = 1; i <= 5; i++) { Console....

Conditional Statements: if, else, and switch

Controlling program flow with decisions

Conditional statements let your program react to different situations. ✅ The if Statement 1 2 3 4 5 int score = 75; if (score >= 60) { Console.WriteLine("You passed!"); } 🛤️ The else Blo...

Control Flow Structures

Making your program smart with decisions and repetition

Control flow lets your program decide what to do next, or repeat actions. 🤔 Conditional Statements If/Else: 1 2 3 4 5 if (score >= 60) { Console.WriteLine("Passed!"); } else { Console....

Type Conversion and Manipulation

Changing and working with data types in C#

Often, you’ll need to change one type into another. C# gives you ways to do this safely. 🔄 Implicit and Explicit Conversion Implicit: C# does it automatically (no risk of data loss): 1 2 int a = ...

Arithmetic, Relational, and Logical Operators

Doing math and making decisions

Operators let you work with numbers, compare values, and combine conditions. C# provides a rich set of operators to perform different operations on variables and values. Operators are grouped by th...