protected internal override Expression VisitEmbeddedEntity(EmbeddedEntityExpression eee) { var embeddedParam = Expression.Parameter(eee.Type); var embeddedAssign = Expression.Assign(embeddedParam, Expression.New(eee.Type)); var embeddedBindings = eee.Bindings.Select(b => { var field = Expression.Field(embeddedParam, b.FieldInfo); var value = b.Binding is ChildProjectionExpression ? VisitMListChildProjection((ChildProjectionExpression)b.Binding, field) : Convert(Visit(b.Binding), b.FieldInfo.FieldType); return(Expression.Assign(field, value)); }).ToList <Expression>(); embeddedBindings.Insert(0, embeddedAssign); if (typeof(EmbeddedEntity).IsAssignableFrom(eee.Type)) { embeddedBindings.Add(Expression.Call(retriever, miModifiablePostRetrieving.MakeGenericMethod(eee.Type), embeddedParam)); } else { embeddedBindings.Add(embeddedParam); } var block = Expression.Block(eee.Type, new[] { embeddedParam }, embeddedBindings); return(Expression.Condition(Expression.Equal(Visit(eee.HasValue.Nullify()), Expression.Constant(true, typeof(bool?))), block, Expression.Constant(null, block.Type))); }
protected internal virtual Expression VisitEmbeddedEntity(EmbeddedEntityExpression eee) { var bindings = Visit(eee.Bindings, VisitFieldBinding); var hasValue = Visit(eee.HasValue); if (eee.Bindings != bindings || eee.HasValue != hasValue) { return(new EmbeddedEntityExpression(eee.Type, hasValue, bindings, eee.FieldEmbedded, eee.ViewTable)); } return(eee); }
protected internal override Expression VisitEmbeddedEntity(EmbeddedEntityExpression eee) { var bindings = VisitBindings(eee.Bindings); var hasValue = Visit(eee.HasValue); if (eee.Bindings != bindings || eee.HasValue != hasValue || eee.EntityContext != null) { return(new EmbeddedEntityExpression(eee.Type, hasValue, bindings, eee.FieldEmbedded, eee.ViewTable, null)); } return(eee); }
protected internal virtual Expression VisitEmbeddedEntity(EmbeddedEntityExpression eee) { var bindings = Visit(eee.Bindings, VisitFieldBinding); var hasValue = Visit(eee.HasValue); var entityContext = eee.EntityContext == null ? null : VisitEntityContextInfo(eee.EntityContext); if (eee.Bindings != bindings || eee.HasValue != hasValue || eee.EntityContext != entityContext) { return(new EmbeddedEntityExpression(eee.Type, hasValue, bindings, eee.FieldEmbedded, eee.ViewTable, entityContext)); } return(eee); }
static Expression EmbeddedNullEquals(EmbeddedEntityExpression eee) { return(Expression.Not(eee.HasValue)); }
protected internal override Expression VisitEmbeddedEntity(EmbeddedEntityExpression eee) { throw InvalidSqlExpression(eee); }
protected virtual bool CompareEmbeddedFieldInit(EmbeddedEntityExpression a, EmbeddedEntityExpression b) { return(Compare(a.HasValue, b.HasValue) && a.FieldEmbedded == b.FieldEmbedded && CompareList(a.Bindings, b.Bindings, CompareFieldBinding)); }
static Expression EmbeddedNullEquals(EmbeddedEntityExpression eee) { return Expression.Not(eee.HasValue); }
protected virtual Expression VisitEmbeddedEntity(EmbeddedEntityExpression eee) { var bindings = eee.Bindings.NewIfChange(VisitFieldBinding); var hasValue = Visit(eee.HasValue); if (eee.Bindings != bindings || eee.HasValue != hasValue) { return new EmbeddedEntityExpression(eee.Type, hasValue, bindings, eee.FieldEmbedded); } return eee; }
protected override Expression VisitEmbeddedEntity(EmbeddedEntityExpression eee) { throw InvalidSqlExpression(eee); }