Exemplo n.º 1
0
        /// <summary>
        /// Tries to get destination type from dynamic supported mappings.
        /// </summary>
        /// <param name="mapper">The mapper.</param>
        /// <param name="sourceType">Type of the source.</param>
        /// <param name="destinationType">Type of the destination.</param>
        /// <returns></returns>
        public static bool TryGetDestinationTypeFromDynamicSupportedMappings(this AbstractMappingEngine mapper, Type sourceType, out Type destinationType)
        {
            var mappings = mapper.GetDynamicSupportedMappings();

            destinationType = mappings.Where(x => x.SourceType == sourceType).Select(x => x.DestinationType).FirstOrDefault();
            return(destinationType != null);
        }