コード例 #1
0
        public void Create_Default()
        {
            var test = new GetErrorRecordExistsQuery("test", 100);

            Assert.Equal("test", test.ExceptionType);
            Assert.Equal(100, test.QueueId);
        }
コード例 #2
0
 public bool Handle(GetErrorRecordExistsQuery <T> query)
 {
     using (var connection = _connectionFactory.Create())
     {
         connection.Open();
         using (var command = connection.CreateCommand())
         {
             _prepareQuery.Handle(query, command, CommandStringTypes.GetErrorRecordExists);
             using (var reader = command.ExecuteReader())
             {
                 return(reader.Read());
             }
         }
     }
 }
        /// <inheritdoc />
        public void Handle(GetErrorRecordExistsQuery <T> query, IDbCommand dbCommand, CommandStringTypes commandType)
        {
            dbCommand.CommandText = _commandCache.GetCommand(commandType);

            var queueid = dbCommand.CreateParameter();

            queueid.ParameterName = "@QueueID";
            queueid.DbType        = DbType.Int64; //WARN should match T
            queueid.Value         = query.QueueId;
            dbCommand.Parameters.Add(queueid);

            var exceptionType = dbCommand.CreateParameter();

            exceptionType.ParameterName = "@ExceptionType";
            exceptionType.DbType        = DbType.AnsiString;
            exceptionType.Size          = 500;
            exceptionType.Value         = query.ExceptionType;
            dbCommand.Parameters.Add(exceptionType);
        }
コード例 #4
0
 /// <summary>
 /// Handles the specified query.
 /// </summary>
 /// <param name="query">The query.</param>
 /// <returns></returns>
 public bool Handle(GetErrorRecordExistsQuery <long> query)
 {
     return(_databaseExists.Exists(_connectionInformation.ConnectionString) && _decorated.Handle(query));
 }
コード例 #5
0
 public void Create_Default()
 {
     var test = new GetErrorRecordExistsQuery("test", 100);
     Assert.Equal("test", test.ExceptionType);
     Assert.Equal(100, test.QueueId);
 }