C# – Remove items from a list

Here are the different ways to remove items from a list: I’ll show examples of using these methods. Remove item by index with List.RemoveAt() You can use List.RemoveAt() to remove an item at an index (0-based). Here’s an example of removing the first and last item from the list: This removes the first item “A” … Read more

C# – Log every method call

I want to log method calls, including their parameter names and values, and what called the method. I want to minimize the amount of coding involved. For example: What options are available? In this article I’ll explain how to use the simple built-in approach. 1 – Create LogMethodCall() utility method The System.Diagnostics.StackFrame class gives us … Read more