Class FhirEnumExtensions
A FHIR enum extensions.
Inheritance
Namespace: Microsoft.Health.Fhir.CodeGenCommon.Extensions
Assembly: Microsoft.Health.Fhir.CodeGenCommon.dll
Syntax
public static class FhirEnumExtensions : object
Methods
| Improve this Doc View SourceParseFhir<T>(String)
A Type extension method that parses a FHIR string literal to a FHIR-Literal tagged enum value.
Declaration
public static T ParseFhir<T>(string literal)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System. |
literal | The literal. |
Returns
Type | Description |
---|---|
T | An Enum. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
ToFhirEnum<T>(String)
A string extension method that converts a FHIR string literal to a FHIR-Literal tagged enum value.
Declaration
public static T ToFhirEnum<T>(this string literal)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System. |
literal | The literal. |
Returns
Type | Description |
---|---|
T | Literal as an Enum. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
ToLiteral(Enum)
An Enum extension method that converts a value to a literal.
Declaration
public static string ToLiteral(this Enum fhirEnum)
Parameters
Type | Name | Description |
---|---|---|
Enum | fhirEnum | The fhirEnumValue to act on. |
Returns
Type | Description |
---|---|
System. |
Value as a string. |
TryFhirEnum<T>(IEnumerable<String>, out IEnumerable<T>)
A string extension method that attempts to to FHIR enum a T from the given string.
Declaration
public static bool TryFhirEnum<T>(this IEnumerable<string> source, out IEnumerable<T> values)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | The source to act on. |
IEnumerable<T> | values | [out] The values. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
TryFhirEnum<T>(String, out T)
A string extension method that attempts to to FHIR enum a T from the given string.
Declaration
public static bool TryFhirEnum<T>(this string literal, out T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System. |
literal | The literal. |
T | value | [out] The value. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
TryParseFhir<T>(String, out T)
A Type extension method that attempts to parse a FHIR string literal to a FHIR-Literal tagged enum value.
Declaration
public static bool TryParseFhir<T>(string literal, out T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System. |
literal | The literal. |
T | value | [out] The value. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |