Ejemplo n.º 1
0
        public override ExecutableQueryExpression BuildQuery()
        {
            var assignments = _assignments.Build();

            return(QueryExpression.Insert(
                       QueryExpression.Table(_tableName),
                       assignments.Columns,
                       assignments.Row
                       ));
        }
Ejemplo n.º 2
0
        public override ExecutableQueryExpression BuildQuery()
        {
            var where = _whereBuilder.Build();
            var assignments = _assignments.Build();

            if (where?.RequiresJoins == true)
            {
                throw new InvalidOperationException("Expressions that require joins aren't valid for DELETE statements.");
            }

            return(QueryExpression.Update(
                       QueryExpression.Table(_tableName),
                       where : where?.QueryExpression,
                       columns: assignments.Columns,
                       values: assignments.Row
                       ));
        }