示例#1
0
 public virtual async Task <int> ExecuteNonQueryAsync(CommandType cmdType, string cmdText,
                                                      params OracleParameter[] commandParameters)
 {
     using (var connection = new OracleConnection(ConnectionString))
     {
         using (var command = new OracleCommand(cmdText, connection))
         {
             try
             {
                 command.CommandType = cmdType;
                 if (commandParameters != null)
                 {
                     command.Parameters.AddRange(commandParameters);
                 }
                 connection.Open();
                 return(await command.ExecuteNonQueryAsync());
             }
             finally
             {
                 connection.Close();
             }
         }
     }
 }