Example #1
0
        public void PartialSelectionReturnsNullAtCompileIfEmpty()
        {
            IPartialSelection <UserEntity, UserDto> selection = DummyQuery <UserEntity>()
                                                                .PartialSelect <UserDto>();

            Expression <Func <UserEntity, UserDto> > expression = selection.Compile();

            Assert.That(expression, Is.Null);
        }
Example #2
0
        /// <inheritdoc />
        public virtual FlowQuerySelection <TDestination> Select <TDestination>
        (
            IPartialSelection <TSource, TDestination> combiner
        )
        {
            if (combiner == null)
            {
                throw new ArgumentNullException("combiner");
            }

            if (combiner.Count == 0)
            {
                throw new ArgumentException("No projection is made in ExpressionCombiner'2", "combiner");
            }

            Expression <Func <TSource, TDestination> > expression = combiner.Compile();

            return(Select(expression));
        }
Example #3
0
        /// <inheritdoc />
        public virtual void Select <TDestination>
        (
            IResultStream <TDestination> stream,
            IPartialSelection <TSource, TDestination> combiner
        )
        {
            if (combiner == null)
            {
                throw new ArgumentNullException("combiner");
            }

            if (combiner.Count == 0)
            {
                throw new ArgumentException("No projection is made in ExpressionCombiner'2", "combiner");
            }

            Expression <Func <TSource, TDestination> > expression = combiner.Compile();

            Select(stream, expression);
        }