Home

Posts

C# Code Snippets Generics

C# Generics

In this code snippet, we will learn about generics in C#. You can make generic classes, properties, methods, and parameters. If we make something generic this means it doesn’t have…
C# Code Snippets Class

C# Class

In this code snippet, we’ll take a look at classes in C#. A class is like a blueprint to make an instance of an object. Inside a class, you can…
C# Code Snippets Indexers

C# Indexers

In this code snippet, we will learn how to implement indexers in C#. Indexers allow classes to be indexed just like arrays. To retrieve or set a value you just…
C# Code Snippets Ref Keyword

C# Ref Keyword

In this code snippet, we’ll what the ref keyword does in C#. Variables can be passed either by value or by reference. Usually, we do it by value meaning you…
C# Code Snippets Exceptions

C# Exceptions

In this code snippet, we will about exceptions in C#. When an error occurs in an application an exception will be thrown. If it’s left unhandled the application will crash…
C# Code Snippets Partial Classes

C# Partial Class

In this code snippet, we will found out what partial classes are in C#. If a class is marked with the partial keyword a class with the same name can…
C# Code Snippets Recursive File Iteration

C# Recursive File Iteration

In this code snippet, we will see how to recursively iterate through files and folders in C#. To recursively iterate through the file system we will first call the getFileNames()…
C# Code Snippets Object and Collection Initializers

C# Object and Collection Initializers

In this code snippet, we will learn how to use object and collection initializers in C#. Initializers let you set any accessible property at the point of creation of an…
C# Code Snippets Recursion

C# Recursion

In this code snippet, we will find out how to use recursion in C#. A recursive function/method is a method that calls itself. The method will contain an if else block…

Advertisment ad adsense adlogger