Class convertinf Source objects to string and the other way.
Exemple #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var source = (Source)value;

            writer.WriteValue(SourceEnumStringConverter.GetString(source));
        }
Exemple #2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var enumString = (string)reader.Value;

            return(SourceEnumStringConverter.GetSource(enumString));
        }