Ejemplo n.º 1
0
        public override Expression GetInsertExpression(MappingEntity entity, Expression instance, LambdaExpression selector)
        {
            var tableAlias  = new TableAlias();
            var table       = new TableExpression(tableAlias, entity, this.mapping.GetTableName(entity));
            var assignments = this.GetColumnAssignments(table, instance, entity, (e, m) => !(mapping.IsGenerated(e, m) || mapping.IsReadOnly(e, m)));   // #MLCHANGE

            if (selector != null)
            {
                return(new BlockCommand(
                           new InsertCommand(table, assignments),
                           this.GetInsertResult(entity, instance, selector, null)
                           ));
            }

            return(new InsertCommand(table, assignments));
        }