public override async Task InsertOrReplace(IBaseReportMetadata reportMetadata)
        {
            var item = await _storage.GetDataAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                                   BaseReportMetadataEntity.GenerateRowKey(reportMetadata.Id));

            reportMetadata.FileUrl = item?.FileUrl;

            await base.InsertOrReplace(reportMetadata);
        }
Exemplo n.º 2
0
        public Task SetStatus(string address, ReportStatus status)
        {
            return(_storage.ReplaceAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                         BaseReportMetadataEntity.GenerateRowKey(address),
                                         p =>
            {
                p.Status = status.ToString();

                return p;
            }));
        }
Exemplo n.º 3
0
        public Task SetProcessing(string address)
        {
            return(_storage.ReplaceAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                         BaseReportMetadataEntity.GenerateRowKey(address),
                                         p =>
            {
                p.Status = ReportStatus.Processing.ToString();
                p.Started = DateTime.UtcNow;

                return p;
            }));
        }
Exemplo n.º 4
0
        public Task SetError(string address, string errorDescr)
        {
            return(_storage.ReplaceAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                         BaseReportMetadataEntity.GenerateRowKey(address),
                                         p =>
            {
                p.Status = ReportStatus.Failed.ToString();
                p.Finished = DateTime.UtcNow;
                p.LastError = errorDescr;

                return p;
            }));
        }
Exemplo n.º 5
0
        public Task SetDone(string address, string fileUrl)
        {
            return(_storage.ReplaceAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                         BaseReportMetadataEntity.GenerateRowKey(address),
                                         p =>
            {
                p.Status = ReportStatus.Done.ToString();
                p.Finished = DateTime.UtcNow;
                p.FileUrl = fileUrl;

                return p;
            }));
        }
Exemplo n.º 6
0
 public virtual Task InsertOrReplace(IBaseReportMetadata reportMetadata)
 {
     return(_storage.InsertOrReplaceAsync(BaseReportMetadataEntity.Create(reportMetadata)));
 }
Exemplo n.º 7
0
 public async Task <IEnumerable <IBaseReportMetadata> > GetAll()
 {
     return(await _storage.GetDataAsync(BaseReportMetadataEntity.GeneratePartitionKey()));
 }
Exemplo n.º 8
0
 public async Task <IBaseReportMetadata> Get(string address)
 {
     return(await _storage.GetDataAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                        BaseReportMetadataEntity.GenerateRowKey(address)));
 }