예제 #1
0
        /// <summary>
        /// Retreives converter for given converter type and result type using ObjectMapperConfiguration (ConverterFactory and ConverterResolver).
        /// </summary>
        /// <param name="converterType">Converter type</param>
        /// <param name="returnType">Result type</param>
        /// <returns>
        /// Converter resolved by ObjectMapperConfiguration.ConverterFactory if converterType parameter is set.
        /// Converter resolved by ObjectMapperConfiguration.ConverterResolver for given returnType if converterType parameter is not set;
        /// </returns>
        public static IPropertyConverter GetConverter(Type converterType, Type returnType)
        {
            if (converterType != null)
            {
                return(_converterFactory.CreateConverter(converterType));
            }

            return(_converterResolver.Resolve(returnType));
        }
예제 #2
0
 public SyntaxNode Convert()
 => Factory.CreateConverter(Converter.Convert()).Convert();