Exemple #1
0
        protected override Expression VisitMarker(MarkerExpression expression)
        {
            var target          = expression.Target;
            var processedTarget = Visit(target);

            if (expression.MarkerType != MarkerType.None && (expression.MarkerType & MarkerType.Default) == MarkerType.None)
            {
                if (itemMaterializationContextParameter == null)
                {
                    return(processedTarget);
                }
                var columns        = ColumnGatherer.GetColumns(target, ColumnExtractionModes.Distinct | ColumnExtractionModes.Ordered).ToArray();
                var sequenceCheck  = Expression.Call(MaterializationHelper.IsNullMethodInfo, tupleParameter, Expression.Constant(columns));
                var throwException = Expression.Convert(Expression.Call(MaterializationHelper.ThrowEmptySequenceExceptionMethodInfo), target.Type);
                return(Expression.Condition(sequenceCheck, throwException, processedTarget));
            }
            return(processedTarget);
        }
 public List <int> GetColumns(ColumnExtractionModes columnExtractionModes)
 {
     return(ColumnGatherer.GetColumns(Item, columnExtractionModes));
 }
 public List <int> GetColumns(ColumnExtractionModes columnExtractionModes) =>
 ColumnGatherer.GetColumns(Item, columnExtractionModes);