Beispiel #1
0
        public static IAccessor <T> Assign <T, K>(this IAccessor <T> accessor, Expression <Func <IAssignableMember <T>, K> > assigner, ICreator <K> creator)
        {
            if (accessor == null)
            {
                throw new NullReferenceException();
            }
            if (assigner == null)
            {
                throw new ArgumentNullException("assigner");
            }
            if (creator == null)
            {
                throw new ArgumentNullException("creator");
            }

            return(new AccessorImpl <T>(AssignCore <T, K>(accessor.Expression, ReflectionBuilder.AssignableMember <T, K>(assigner), Expression.Lambda <Func <T, K> >(creator.Expression.Body, Expression.Parameter(typeof(T))))));
        }
Beispiel #2
0
        public static IAccessor <T> Assign <T, K>(this IAccessor <T> accessor, Expression <Func <IAssignableMember <T>, K> > assigner, Expression <Func <IValue <T>, K> > parameter)
        {
            if (accessor == null)
            {
                throw new NullReferenceException();
            }
            if (assigner == null)
            {
                throw new ArgumentNullException("assigner");
            }
            if (parameter == null)
            {
                throw new ArgumentNullException("parameter");
            }

            return(new AccessorImpl <T>(AssignCore <T, K>(accessor.Expression, ReflectionBuilder.AssignableMember <T, K>(assigner), ReflectionBuilder.GetParameter <T, K>(parameter))));
        }
Beispiel #3
0
 public static ICopier <T, R> Copy <T, R, K>(this ICopier <T, R> copier, Expression <Func <IReturnableMember <T>, K> > source, Expression <Func <IAssignableMember <R>, K> > target)
 {
     return(new CopierImpl <T, R>(CopyCore <T, R, K>(copier.Expression, ReflectionBuilder.ReturnableMember <T, K>(source), ReflectionBuilder.AssignableMember <R, K>(target))));
 }