Newtonsoft.Json.JsonWriter.CreateUnsupportedTypeException C# (CSharp) Method

CreateUnsupportedTypeException() private static method

private static CreateUnsupportedTypeException ( JsonWriter writer, object value ) : JsonWriterException
writer JsonWriter
value object
return JsonWriterException
        private static JsonWriterException CreateUnsupportedTypeException(JsonWriter writer, object value)
        {
            return JsonWriterException.Create(writer, "Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null);
        }

Usage Example

Ejemplo n.º 1
0
 public virtual void WriteValue(object value)
 {
     if (value == null)
     {
         this.WriteNull();
         return;
     }
     if (value is BigInteger)
     {
         throw JsonWriter.CreateUnsupportedTypeException(this, value);
     }
     JsonWriter.WriteValue(this, ConvertUtils.GetTypeCode(value), value);
 }
All Usage Examples Of Newtonsoft.Json.JsonWriter::CreateUnsupportedTypeException