Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Benchmarks/SerializationBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ public string XmlDictionarySerializer()
[Benchmark]
public string TypedElementSerializerJson()
{
#pragma warning disable SDK0001
return Patient.ToTypedElement().ToJson();
#pragma warning restore SDK0001
}

[Benchmark]
public string TypedElementSerializerXml()
{
#pragma warning disable SDK0001
return Patient.ToTypedElement().ToXml();
#pragma warning restore SDK0001
}
}
}
12 changes: 9 additions & 3 deletions src/Hl7.Fhir.Base/ElementModel/PocoBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
using Hl7.Fhir.Introspection;
using Hl7.Fhir.Model;
using Hl7.Fhir.Serialization;
using Hl7.Fhir.Utility;
using System;
using System.Diagnostics.CodeAnalysis;

namespace Hl7.Fhir.ElementModel
{
Expand All @@ -28,8 +30,12 @@ public static T ToPoco<T>(this ITypedElement element, ModelInspector inspector,
public static Base ToPoco(this ITypedElement element, ModelInspector inspector, PocoBuilderSettings settings = null) =>
new NewPocoBuilder(inspector, settings ?? new PocoBuilderSettings()).BuildFrom(element);

public static ISourceNode ToSourceNode(this Base @base, ModelInspector inspector, string rootName = null) =>
@base.ToTypedElement(inspector, rootName).ToSourceNode();

public static ISourceNode ToSourceNode(this Base @base, ModelInspector inspector, string rootName = null)
Comment thread
ewoutkramer marked this conversation as resolved.
{
var node = @base.ToElementNode(rootName);
((IAnnotatable)node).AddAnnotation(inspector);

return node;
}
}
}
211 changes: 0 additions & 211 deletions src/Hl7.Fhir.Base/ElementModel/PocoElementNode2.cs

This file was deleted.

Loading