Back-end
21 posts
2021
How to kill a thread in C# using Thread.Abort() and handle ThreadAbortException safely.
How to use OfType in LINQ to filter a collection by type in C#, with practical examples.
How to use SelectMany in LINQ to flatten nested collections in C#, with real-world examples.
How to use Where in LINQ to filter collections in C#, with method syntax and query syntax examples.
How to use Select in LINQ to transform collections in C#, with method syntax and query syntax examples.
How to hash a string in C# using MD5, SHA256, and other algorithms from System.Security.Cryptography.
The difference between implicit and explicit casting in C#, with examples of when each is needed.
Boxing and unboxing in C# explained. How value types convert to reference types and back again.
How to throw multiple exceptions at once in C# using AggregateException to batch validation errors.
The 15 most common C# exceptions you'll encounter, with explanations and when each one is thrown.
How to check if PowerShell is installed on a Windows machine before running scripts from C#.
How to access and handle inner exceptions in C# using the InnerException property.
How to catch multiple exception types in C# using a single catch block for the base Exception class.
How to create custom exception classes in C# by inheriting from the Exception base class.
How try, catch, and finally blocks work together in C# to handle exceptions and clean up resources.
How to rethrow an exception in C# without losing the original stack trace, using throw vs throw ex.
How to catch exceptions in C# using try-catch blocks, with examples for handling specific exception types.
How to throw exceptions in C# using the throw keyword, with examples for different exception types.
How to use async and await in C# to write non-blocking code, with practical examples.
How to chain async operations in C# using ContinueWith and continuation tasks, with practical examples.
How to use ThreadPool in C# to reuse threads efficiently instead of creating and destroying them each time.