public static FieldConverter ExcludeChangedTypes(IJsonSerializer jsonSerializer) { return((data, field) => { foreach (var value in data.Values) { if (value.Type == JsonValueType.Null) { continue; } try { if (!JsonValueValidator.IsValid(field, value, jsonSerializer)) { return null; } } catch { return null; } } return data; }); }
public static ValueConverter ExcludeChangedTypes(IJsonSerializer jsonSerializer) { return((value, field, parent) => { if (value.Type == JsonValueType.Null) { return value; } try { if (!JsonValueValidator.IsValid(field, value, jsonSerializer)) { return null; } } catch { return null; } return value; }); }