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

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

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

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