Beispiel #1
0
        private MappingConfigContinuation <TSource, TTarget> CreateCallbackFactory <TAction>(TAction callback)
        {
            var callbackLambda = ConfiguredLambdaInfo.ForAction(callback, typeof(TSource), typeof(TTarget), typeof(TObject));

            var creationCallbackFactory = new ObjectCreationCallbackFactory(
                ConfigInfo,
                typeof(TObject),
                CallbackPosition,
                callbackLambda);

            ConfigInfo.MapperContext.UserConfigurations.Add(creationCallbackFactory);

            return(new MappingConfigContinuation <TSource, TTarget>(ConfigInfo));
        }
        private MappingConfigContinuation <TSource, TTarget> CreateCallbackFactory <TAction>(TAction callback)
        {
            ThrowIfStructMemberCallback();

            var callbackLambda = ConfiguredLambdaInfo
                                 .ForAction(callback, _configInfo, typeof(TSource), typeof(TTarget));

            var creationCallbackFactory = new MappingCallbackFactory(
                _configInfo,
                callbackLambda,
                _targetMember);

            _configInfo.UserConfigurations.Add(creationCallbackFactory);

            return(new MappingConfigContinuation <TSource, TTarget>(_configInfo));
        }