public void Create_Default()
        {
            var test = new GetErrorRecordExistsQuery("test", 100);

            Assert.Equal("test", test.ExceptionType);
            Assert.Equal(100, test.QueueId);
        }
 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);
        }
 /// <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));
 }
 public void Create_Default()
 {
     var test = new GetErrorRecordExistsQuery("test", 100);
     Assert.Equal("test", test.ExceptionType);
     Assert.Equal(100, test.QueueId);
 }