コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: FhirUtils.cs プロジェクト: helsenorge/fhir-tools
        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);
            }
        }