Woopsa.WoopsaExceptionMessage.WoopsaCastTypeMessage C# (CSharp) Method

WoopsaCastTypeMessage() public static method

public static WoopsaCastTypeMessage ( string destinationType, string sourceType ) : string
destinationType string
sourceType string
return string
        public static string WoopsaCastTypeMessage(string destinationType, string sourceType)
        {
            return string.Format("Cannot typecast woopsa value of type {0} to type {1}", sourceType, destinationType);
        }

Usage Example

Example #1
0
 public static double ToDouble(this WoopsaJsonData data)
 {
     if (data.IsSimple)
     {
         return(data.InternalObject.GetDouble());
     }
     else
     {
         throw new WoopsaException(WoopsaExceptionMessage.WoopsaCastTypeMessage("double", data.InternalObject.GetType().ToString()));
     }
 }
All Usage Examples Of Woopsa.WoopsaExceptionMessage::WoopsaCastTypeMessage