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

            using JsonWriter writer = new JsonTextWriter(new StreamWriter(path));
            var serializer = new R4Serialization.FhirJsonSerializer(new SerializerSettings {
                Pretty = pretty
            });

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

            using (JsonWriter writer = new JsonTextWriter(new StreamWriter(path)))
            {
                var serializer = new R4Serialization.FhirJsonSerializer(new SerializerSettings {
                    Pretty = pretty
                });
                serializer.Serialize(resource, writer);
            }
        }