Posts
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# 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# 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# 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# 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# 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# 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# 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…