Пример #1
0
        protected TValueType CastTemplate(FhirValueType template)
        {
            EnsureArg.IsNotNull(template, nameof(template));

            if (!(template is TValueType castTemplate))
            {
                throw new NotSupportedException($"Template type {template.GetType()} does not match supported type {SupportedValueType}.");
            }

            return(castTemplate);
        }
Пример #2
0
        private IFhirValueProcessor <TInValue, TOutValue> ProcessorLookup(FhirValueType template)
        {
            EnsureArg.IsNotNull(template);
            var type = template.GetType();

            if (!_registeredValueProcessors.TryGetValue(type, out var processor))
            {
                throw new NotSupportedException($"Value processor for FhirValueType {type} not supported.");
            }

            return(processor);
        }