Esempio n. 1
0
        private object ExecuteLinqNonQuery(EntitySession session, LinqCommand command, DataConnection conn)
        {
            var sql        = SqlFactory.GetLinqSql(command);
            var fmtOptions = command.Options.IsSet(QueryOptions.NoParameters) ?
                             SqlGenMode.NoParameters : SqlGenMode.PreferParam;
            var cmdBuilder = new DataCommandBuilder(this._driver);

            cmdBuilder.AddLinqStatement(sql, command.ParamValues);
            var dataCmd = cmdBuilder.CreateCommand(conn, DbExecutionType.NonQuery, sql.ResultProcessor);

            ExecuteDataCommand(dataCmd);
            return(dataCmd.ProcessedResult ?? dataCmd.Result);
        }
Esempio n. 2
0
 protected void AddScheduledCommands(IList <LinqCommand> commands)
 {
     if (commands == null || commands.Count == 0)
     {
         return;
     }
     foreach (var lcmd in commands)
     {
         CheckCurrentCommand();
         var sql = _sqlFactory.GetLinqSql(lcmd);
         _commandBuilder.AddLinqStatement(sql, lcmd.ParamValues);
     }//foreach schCmd
 }
Esempio n. 3
0
        public object ExecuteLinqSelect(EntitySession session, LinqCommand command, DataConnection conn)
        {
            var sql     = SqlFactory.GetLinqSql(command);
            var genMode = command.Options.IsSet(QueryOptions.NoParameters) ?
                          SqlGenMode.NoParameters : SqlGenMode.PreferParam;
            var cmdBuilder = new DataCommandBuilder(this._driver, batchMode: false, mode: genMode);

            cmdBuilder.AddLinqStatement(sql, command.ParamValues);
            var dataCmd = cmdBuilder.CreateCommand(conn, DbExecutionType.Reader, sql.ResultProcessor);

            ExecuteDataCommand(dataCmd);
            return(dataCmd.ProcessedResult);
        }