Esempio n. 1
0
 public static decimal ToDecimal(object value, decimal def = 0)
 {
     if (value == null)
     {
         return(def);
     }
     return(TryParse.ToDecimal(value.ToString(), def));
 }
Esempio n. 2
0
 public static DateTime ToDateTime(object value, DateTime?def = null)
 {
     if (value == null)
     {
         return((def == null) ? DateTime.MinValue : (DateTime)def);
     }
     return(TryParse.ToDateTime(value.ToString(), def));
 }
Esempio n. 3
0
 public static Int32 ToInt32(object value, Int32 def = 0)
 {
     if (value == null)
     {
         return(def);
     }
     return(TryParse.ToInt32(value.ToString(), def));
 }