public static string WoopsaCastTypeMessage(string destinationType, string sourceType) { return string.Format("Cannot typecast woopsa value of type {0} to type {1}", sourceType, destinationType); }
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())); } }