private Code GetCode(Type returnType, string codeValue, string codeSystem) { CodeResolver resolver = CodeResolverRegistry.GetResolver(returnType); return(StringUtils.IsBlank(codeSystem) ? resolver.Lookup <Code>(returnType, codeValue) : resolver.Lookup <Code>(returnType, codeValue, codeSystem)); }
private Code GetCode(Type expectedReturnType, string codeValue, string codeSystem) { CodeResolver resolver = null; Type returnType = null; if (typeof(ANY <object>).Equals(expectedReturnType)) { // if the underlying datatype is an ANY, then we don't have enough information to figure out the domaintype; have to assume generic Code returnType = typeof(Code); resolver = new TrivialCodeResolver(); } else { returnType = GetReturnTypeAsCodeType(expectedReturnType); resolver = CodeResolverRegistry.GetResolver(returnType); } return(StringUtils.IsBlank(codeSystem) ? resolver.Lookup <Code>(returnType, codeValue) : resolver.Lookup <Code>(returnType , codeValue, codeSystem)); }