C# Tips and Tricks: Checking for empty strings

When checking to see if a string is empty I got tired of checking for null and then seeing if it was empty now I only use the following method.

public string StandardMethodName(string inputString)
{
 if(string.IsNullOrEmpty(inputString))
 {
  inputString = "Default value";
 }

 return inputString;
}

C# Tips and Tricks: Setting default DateTime values

Here is the standard way that I set default values for a DateTime field. I like to set defaults for my DateTime fields whenever it makes sense. In this example I am setting the values so that it will return all the data for the last month, including the current day.

public bool StandardMethodName(DateTime? startDate, DateTime? endDate)
{
     startDate = startDate.GetValueOrDefault(DateTime.Today.AddMonths(-1));
     endDate = endDate.GetValueOrDefault(DateTime.Now);

     return ProcessInfo(startDate, endDate);
}