-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2973 from FirelyTeam/6.0/remove-idictionary
Remove Children, NamedChildren and IDictionary
- Loading branch information
Showing
677 changed files
with
8,608 additions
and
89,787 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#nullable enable | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
namespace Hl7.Fhir.Model; | ||
|
||
public static class BaseExtensions | ||
{ | ||
[Obsolete("Use GetElementPairs() instead. Note that with GetElementPairs(), the elements are not guaranteed to " + | ||
"be the same type, as they reflect the type in the actual POCO definition.")] | ||
public static IEnumerable<Base> Children(this Base instance) | ||
{ | ||
foreach (var element in instance.GetElementPairs()) | ||
{ | ||
switch (element.Key, element.Value) | ||
{ | ||
case ("div", XHtml xhtml): | ||
yield return new FhirString(xhtml.Value); | ||
break; | ||
case ("id", string id): | ||
yield return new FhirString(id); | ||
break; | ||
case ("url", string url): | ||
yield return new FhirUri(url); | ||
break; | ||
case (_, IEnumerable<Base> list): | ||
foreach (var item in list) | ||
yield return item; | ||
break; | ||
case("value", _) when instance is PrimitiveType: | ||
yield break; | ||
default: | ||
yield return (Base)element.Value; | ||
break; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.