Ejemplo n.º 1
0
        protected override Expression VisitObjectReference(SqlObjectReferenceExpression objectReference)
        {
            SqlObjectReferenceExpression current;

            if (!TryGetCurrent(objectReference, out current))
            {
                return(objectReference);
            }

            if (Object.Equals(current.Type, objectReference.Type))
            {
                return(objectReference);
            }

            result = result && (current.Bindings.Count == objectReference.Bindings.Count);

            if (result)
            {
                currentObject = current.Bindings;
                VisitBindingList(objectReference.Bindings);
                currentObject = current;
            }

            return(objectReference);
        }
Ejemplo n.º 2
0
        protected virtual Expression VisitObjectReference(SqlObjectReferenceExpression objectReferenceExpression)
        {
            var newBindings = this.VisitBindingList(objectReferenceExpression.Bindings);

            if (!Object.ReferenceEquals(newBindings, objectReferenceExpression.Bindings))
            {
                return(new SqlObjectReferenceExpression(objectReferenceExpression.Type, newBindings));
            }
            else
            {
                return(objectReferenceExpression);
            }
        }
        protected override Expression VisitObjectReference(SqlObjectReferenceExpression expression)
        {
            SqlObjectReferenceExpression current;
            if (!TryGetCurrent(expression, out current))
            {
                return expression;
            }

            if (!(this.result &= current.NodeType == expression.NodeType))
            {
                return expression;
            }

            if (!(this.result &= current.Type == expression.Type))
            {
                return expression;
            }

            this.currentObject = current.Bindings;
            this.VisitBindingList(expression.Bindings);
            if (!this.result)
            {
                return expression;
            }

            this.currentObject = current;
            return expression;
        }
Ejemplo n.º 4
0
        protected override Expression VisitObjectReference(SqlObjectReferenceExpression sqlObjectReferenceExpression)
        {
            var arrayOfValues = Expression.NewArrayInit(typeof(object), sqlObjectReferenceExpression
                .Bindings
                .OfType<MemberAssignment>()
                .Select(c => (Expression)Expression.Convert(c.Expression.NodeType == (ExpressionType)SqlExpressionType.Column ? this.ConvertColumnToDataReaderRead((SqlColumnExpression)c.Expression, c.Expression.Type.MakeNullable()) : this.Visit(c.Expression), typeof(object))).ToArray());

            var method = MethodInfoFastRef.DataAccessModelGetReferenceByPrimaryKeyWithPrimaryKeyValuesMethod.MakeGenericMethod(sqlObjectReferenceExpression.Type);

            return Expression.Call(Expression.Property(this.objectProjector, "DataAccessModel"), method, arrayOfValues);
        }
Ejemplo n.º 5
0
        protected override Expression VisitObjectReference(SqlObjectReferenceExpression objectReferenceExpression)
        {
            this.Write("ObjectReference(");
            this.Write(objectReferenceExpression.Type.Name);
            this.Write(")");

            return objectReferenceExpression;
        }
Ejemplo n.º 6
0
		protected virtual Expression VisitObjectReference(SqlObjectReferenceExpression objectReferenceExpression)
		{
			var newBindings = this.VisitBindingList(objectReferenceExpression.Bindings);

			if (!ReferenceEquals(newBindings, objectReferenceExpression.Bindings))
			{
				return new SqlObjectReferenceExpression(objectReferenceExpression.Type, newBindings);
			}
			else
			{
				return objectReferenceExpression;
			}
		}
Ejemplo n.º 7
0
 protected override Expression VisitObjectReference(SqlObjectReferenceExpression objectReferenceExpression)
 {
     return(base.VisitObjectReference(objectReferenceExpression));
 }