예제 #1
0
 public ProviderEvent(ProviderEvent other)
 {
     Id          = other.Id;
     Description = other.Description;
     Content     = other.Content;
     Created     = other.Created;
 }
예제 #2
0
        private static async Task SaveToStorageAsync(Storage storage, string collectionName, ProviderEvent providerEvent, ILogger log)
        {
            log.LogInformation($"Saving event to {collectionName}.");

            var entityId = providerEvent.Id;

            var entity = new EventEntity(entityId, providerEvent.Created);

            entity.Id          = providerEvent.Id;
            entity.Created     = providerEvent.Created > DateTime.MinValue ? providerEvent.Created : DateTime.Now;
            entity.Content     = Utils.Zip(providerEvent.Content);
            entity.Description = providerEvent.Description;

            await entity.SaveToStorageAsync(storage.Table, storage.BlobContainer);
        }
예제 #3
0
 private static async Task SendToQueueAsync(CloudQueue queue, string collectionName, ProviderEvent providerEvent, ILogger log)
 {
     var envelope = new Dictionary <string, object>
     {
         { EventCollectionElementName, collectionName },
         { EventPayloadElementName, providerEvent },
     };
     var messageText = JsonConvert.SerializeObject(envelope);
     var message     = new CloudQueueMessage(messageText);
     await queue.AddMessageAsync(message);
 }