A new handy method that I just discovered in C# and I wish I knew it before is: String.IsNullOrEmpty(string value).
Whenever you are checking your string variables for null reference value you can just use this method instead of directly comparing your variable to null. I use this quite often when I needed to pass to my parameters either a string value or a null.
Example:
A method below will check if your string variable is null and therefore return null or a string value.
// Method that checks if string reference value is null
private string IsStringNull(string ValidString)
{
if (String.IsNullOrEmpty(ValidString) == true)
{ ValidString = null; }
else
{ ValidString = ValidString; }
return ValidString;
}
49ba029c-b32d-43d4-8e29-5d5cf9a42f75|0|.0