예제 #1
0
        /// <inheritdoc/>
        public IConvertRegistration <TSource, TTarget> RegisterMergeLevel <TSourceValue, TTargetValue, TMergeValue, TConvertIntention>(
            Func <TSource, IEnumerable <TMergeValue> > mergeFunc,
            Func <TMergeValue, IEnumerable <TSourceValue> > sourceFunc,
            Expression <Func <TTarget, ICollection <TTargetValue> > > targetExpression,
            ICreateConvertHelper <TSourceValue, TTargetValue, TTarget, TConvertIntention> createConvertHelper)
            where TSourceValue : class
            where TTargetValue : class
            where TMergeValue : class
            where TConvertIntention : IBaseConvertIntention
        {
            mergeFunc.NotNull(nameof(mergeFunc));
            sourceFunc.NotNull(nameof(sourceFunc));
            targetExpression.NotNull(nameof(targetExpression));
            createConvertHelper.NotNull(nameof(createConvertHelper));

            var operation =
                this.serviceLocator
                .GetInstance <IOperationMergeLevel <TSource, TTarget, TSourceValue, TTargetValue, TMergeValue, TConvertIntention> >();

            operation.Initialize(
                mergeFunc,
                sourceFunc,
                targetExpression,
                createConvertHelper);
            this.convertHelperOperationWorkUnits.Add(operation);
            return(this);
        }
예제 #2
0
        /// <inheritdoc/>
        public void Initialize(
            Expression <Func <TTarget, TTargetValue> > targetExpression,
            ICreateConvertHelper <TSource, TTargetValue, TTarget, TConvertIntention> createConvertHelper)
        {
            targetExpression.NotNull(nameof(targetExpression));
            createConvertHelper.NotNull(nameof(createConvertHelper));

            this.targetExpression    = targetExpression;
            this.createConvertHelper = createConvertHelper;
        }
예제 #3
0
        /// <inheritdoc/>
        public void Initialize(
            Func <TSource, TSourceValue> sourceFunc,
            Expression <Func <TTarget, TTargetValue> > targetExpression,
            ICreateConvertHelper <TSourceValue, TTargetValue, TConcreteTargetValue, TTarget, TConvertIntention> createConvertHelper)
        {
            sourceFunc.NotNull(nameof(sourceFunc));
            targetExpression.NotNull(nameof(targetExpression));
            createConvertHelper.NotNull(nameof(createConvertHelper));

            this.sourceFunc          = sourceFunc;
            this.targetExpression    = targetExpression;
            this.createConvertHelper = createConvertHelper;
        }
        /// <inheritdoc/>
        public void Initialize(
            Func <TSource, IEnumerable <TSourceValue> > sourceFunc,
            Expression <Func <TTarget, ICollection <TTargetValue> > > targetExpression,
            ICreateConvertHelper <TSourceValue, TTargetValue, TReverseRelation, TConvertIntention> createConvertHelper)
        {
            sourceFunc.NotNull(nameof(sourceFunc));
            targetExpression.NotNull(nameof(targetExpression));
            createConvertHelper.NotNull(nameof(createConvertHelper));

            this.sourceFunc          = sourceFunc;
            this.targetExpression    = targetExpression;
            this.createConvertHelper = createConvertHelper;
        }
예제 #5
0
        /// <inheritdoc/>
        public void Initialize(
            Func <TSource, TTarget, IEnumerable <TSourceValue> > sourceFunc,
            Expression <Func <TTarget, ICollection <TTargetValue> > > targetExpression,
            Func <TSource, TTarget, bool> toOneHistCriteria,
            Func <TSource, TTarget, DateTime> toOneReferenceDate,
            ICreateConvertHelper <TSourceValue, TTargetValue, TReverseRelation, TConvertIntention> createConvertHelper)
        {
            sourceFunc.NotNull(nameof(sourceFunc));
            targetExpression.NotNull(nameof(targetExpression));
            toOneHistCriteria.NotNull(nameof(toOneHistCriteria));
            toOneReferenceDate.NotNull(nameof(toOneReferenceDate));
            createConvertHelper.NotNull(nameof(createConvertHelper));

            this.sourceFunc          = sourceFunc;
            this.targetExpression    = targetExpression;
            this.toOneHistCriteria   = toOneHistCriteria;
            this.toOneReferenceDate  = toOneReferenceDate;
            this.createConvertHelper = createConvertHelper;
        }