private static void SerializeResourceToDiskAsXmlR4(this Resource resource, string path, bool pretty = true)
        {
            EnsureArg.IsNotNullOrWhiteSpace(path, nameof(path));

            using XmlWriter writer = new XmlTextWriter(new StreamWriter(path));
            var serializer = new R4Serialization.FhirXmlSerializer(new SerializerSettings {
                Pretty = pretty
            });

            serializer.Serialize(resource, writer);
        }
Beispiel #2
0
        protected void SerializeR4ResourceToDiskAsXml(Resource resource, string path, bool pretty = true)
        {
            EnsureArg.IsNotNullOrWhiteSpace(path, nameof(path));

            using (XmlWriter writer = new XmlTextWriter(new StreamWriter(path)))
            {
                var serializer = new R4Serialization.FhirXmlSerializer(new SerializerSettings {
                    Pretty = pretty
                });
                serializer.Serialize(resource, writer);
            }
        }