/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false); if (!string.IsNullOrEmpty(ContentString)) { writer.WriteString("contentString", (string)ContentString !); } if (_ContentString != null) { writer.WritePropertyName("_contentString"); _ContentString.SerializeJson(writer, options); } if (ContentAttachment != null) { writer.WritePropertyName("contentAttachment"); ContentAttachment.SerializeJson(writer, options); } if (ContentReference != null) { writer.WritePropertyName("contentReference"); ContentReference.SerializeJson(writer, options); } if (includeStartObject) { writer.WriteEndObject(); } }