예제 #1
0
        public override void CreateMap(TypeAdapterConfig configuration, Type destination)
        {
            if (TargetTypes.IsNullOrEmpty())
            {
                return;
            }

            foreach (Type source in TargetTypes)
            {
                MethodInfo mapToDestination = configuration.GetType().GetMethod("NewConfig").MakeGenericMethod(source, destination);
                MethodInfo mapToSource      = configuration.GetType().GetMethod("NewConfig").MakeGenericMethod(destination, source);
                mapToDestination.Invoke(configuration, null);
                mapToSource.Invoke(configuration, null);
            }
        }