Пример #1
0
 protected Queue(string queueConnectionString, string queueName,
                 string storageConnectionString, string storageName,
                 IJsonConverter jsonConverter,
                 ISecurityService securityService)
 {
     _jsonConverter = jsonConverter;
     _queueClient   = new Lazy <QueueClient>(
         () => new QueueClient(queueConnectionString, queueName, ReceiveMode.ReceiveAndDelete));
     _queueStorage = new QueueStorage <TWrapper>(storageConnectionString, storageName, jsonConverter,
                                                 securityService);
 }
Пример #2
0
        public static async Task <TWrapper> ConvertBack(string message, IJsonConverter jsonConverter, QueueStorage <TWrapper> queueStorage)
        {
            var queueMessage = jsonConverter.Deserialize <QueueMessage>(message);

            return(await queueStorage.Retrieve(queueMessage.Id.ToString(), true));
        }