If you create a method that return a list and you don’t have data, always return empty list instead of null. This would allow the caller to iterate the list without checking. As an example, consider the 2 blocks of code below, which is better? Having said that, if you write caller side code and …
Tag Archives: best practices
C# Exception Handler
Given the code below, how would you add exception handling in your code? Some developer would handle like this While other do something like this Which style is more readable?