Catel.ObjectToStringHelper.ToString C# (CSharp) Method

ToString() public static method

Returns a string that represents the instance. If the instance is null, this method will return "null". This method is great when the value of a property must be logged.
public static ToString ( object instance ) : string
instance object The instance, can be null.
return string
        public static string ToString(object instance)
        {
            return ToString(instance, DefaultCulture);
        }

Same methods

ObjectToStringHelper::ToString ( object instance, CultureInfo cultureInfo ) : string

Usage Example

Example #1
0
 public static void IsNotNull(string paramName, object paramValue)
 {
     if (paramValue == null)
     {
         Log.Error("Argument '{0}' cannot be null", ObjectToStringHelper.ToString(paramName));
         throw new ArgumentNullException(paramName);
     }
 }
All Usage Examples Of Catel.ObjectToStringHelper::ToString