/// <inheritdoc /> public IDictionary <string, object> Handle(GetHeaderQuery query) { using (var connection = _connectionFactory.Create()) { connection.Open(); using (var command = connection.CreateCommand()) { _prepareQuery.Handle(query, command, CommandStringTypes.GetHeader); using (var reader = command.ExecuteReader()) { if (!reader.Read()) { return(null); } var headerRaw = _readColumn.ReadAsByteArray(CommandStringTypes.GetHeader, 0, reader); if (headerRaw != null) { return(_serialization.InternalSerializer .ConvertBytesTo <IDictionary <string, object> >( headerRaw)); } } } } return(null); }
public IDictionary <string, object> Handle(GetHeaderQuery query) { var headers = _lua.Execute(query.Id.Id.Value.ToString()); if (headers != null) { return(_serialization.InternalSerializer.ConvertBytesTo <IDictionary <string, object> >(headers)); } return(null); }
/// <inheritdoc /> public void Handle(GetHeaderQuery query, IDbCommand dbCommand, CommandStringTypes commandType) { dbCommand.CommandText = _commandCache.GetCommand(commandType); var queueid = dbCommand.CreateParameter(); queueid.ParameterName = "@queueID"; queueid.DbType = DbType.Int64; queueid.Value = query.Id; dbCommand.Parameters.Add(queueid); }
/// <inheritdoc /> public IDictionary <string, object> Handle(GetHeaderQuery <int> query) { using (var db = _connectionInformation.GetDatabase()) { var queue = db.Database.GetCollection <Schema.QueueTable>(_tableNameHelper.QueueName); var queueRecord = queue.FindById(query.Id); if (queueRecord != null) { var headers = _serialization.InternalSerializer.ConvertBytesTo <IDictionary <string, object> >(queueRecord .Headers); return(headers); } } return(null); }