Example #1
0
        public override Expression BindParameter(ParameterExpression parameter, Dictionary <Expression, Expression> processedExpressions)
        {
            Expression result;

            if (processedExpressions.TryGetValue(this, out result))
            {
                return(result);
            }
            result = new EntitySetExpression(Field, parameter, DefaultIfEmpty);
            if (base.Owner == null)
            {
                return(result);
            }
            processedExpressions.Add(this, result);
            Owner.BindParameter(parameter, processedExpressions);
            return(result);
        }
 private static PersistentFieldExpression BuildNestedFieldExpression(FieldInfo nestedField, int offset)
 {
     if (nestedField.IsPrimitive)
     {
         return(FieldExpression.CreateField(nestedField, offset));
     }
     if (nestedField.IsStructure)
     {
         return(StructureFieldExpression.CreateStructure(nestedField, offset));
     }
     if (nestedField.IsEntity)
     {
         return(EntityFieldExpression.CreateEntityField(nestedField, offset));
     }
     if (nestedField.IsEntitySet)
     {
         return(EntitySetExpression.CreateEntitySet(nestedField));
     }
     throw new NotSupportedException(string.Format(Strings.ExNestedFieldXIsNotSupported, nestedField.Attributes));
 }
Example #3
0
        public override Expression Remap(int[] map, Dictionary <Expression, Expression> processedExpressions)
        {
            if (!CanRemap)
            {
                return(this);
            }

            Expression result;

            if (processedExpressions.TryGetValue(this, out result))
            {
                return(result);
            }
            result = new EntitySetExpression(Field, null, DefaultIfEmpty);
            if (base.Owner == null)
            {
                return(result);
            }
            processedExpressions.Add(this, result);
            Owner.Remap(map, processedExpressions);
            return(result);
        }