public JsonValue ToJson(JsonSerializer serializer) { var json = new JsonObject(); Id.Serialize(json, serializer, "id"); Bio.Serialize(json, serializer, "bio"); FullName.Serialize(json, serializer, "fullName"); Initials.Serialize(json, serializer, "initials"); Username.Serialize(json, serializer, "username"); AvatarSource.Serialize(json, serializer, "avatarSource"); Email.Serialize(json, serializer, "email"); OneTimeMessagesDismissed.Serialize(json, serializer, "oneTimeMessagesDismissed"); if (Prefs != null) { json.Add("prefs/minutesBetweenSummaries", Prefs.MinutesBetweenSummaries); json.Add("prefs/colorBlind", Prefs.ColorBlind); } return(json); }