Пример #1
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))));
        }
Пример #2
0
        public static IAccessor <T> Return <T, K>(this IAccessor <T> accessor, Expression <Func <T, K> > selector, Expression <Func <IValue <T>, K> > parameter)
        {
            if (accessor == null)
            {
                throw new NullReferenceException();
            }
            if (selector == null)
            {
                throw new ArgumentNullException("selector");
            }
            if (parameter == null)
            {
                throw new ArgumentNullException("parameter");
            }

            return(new AccessorImpl <T>(ReturnCore <T, K>(accessor.Expression, selector, ReflectionBuilder.GetParameter <T, K>(parameter))));
        }