
C# the use of ref keyword
In C# when using the ref keyword it causes an argument to be passed by reference, not by value. In order to use a ref as a parameter, both the method definition and the calling method must explicitly use the…
Practical guides on AI agents, LLM security, C#/.NET and Cloud, from Taswar Bhatti

In C# when using the ref keyword it causes an argument to be passed by reference, not by value. In order to use a ref as a parameter, both the method definition and the calling method must explicitly use the…

.NET provides in its System.IO namespace the Path class which performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner. Most of the time we see develeopers writing code like…
Read more: C# tip: Use Path Combine for file or directory path information

Recently have been going through some old code to review the comments in them from other developers and what I find out is developers tend to have really bad comments & documentation in their code Example: public class Person {…
Read more: Documentation comment your C# code use GhostDoc at least

Here is a LINQ tip where you may wish to order a collection with an existing ordering of another collection. Example: int[] displaySeq = new int[] { 1, 8, 5, 7, 13 }; //the ordering we want at the end…
Read more: LINQ tip – Ordering collection using existing array/collection using OrderBy

Obsolete or Deprecated? How do you mark a class or method as deprecated/obsolete? By using the Obsolete attribute [Obsolete] public class Person { } [Obsolete(“Class is obsolete, use PersonImpl”)] public class Person { } //compilation to fail methods calling this…
Read more: C# tip – Marking method or class as Obsolete/Deprecated