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);
        }
示例#2
0
        public Task SetStatus(string address, ReportStatus status)
        {
            return(_storage.ReplaceAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                         BaseReportMetadataEntity.GenerateRowKey(address),
                                         p =>
            {
                p.Status = status.ToString();

                return p;
            }));
        }
示例#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;
            }));
        }
示例#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;
            }));
        }
示例#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;
            }));
        }
示例#6
0
 public async Task <IBaseReportMetadata> Get(string address)
 {
     return(await _storage.GetDataAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                        BaseReportMetadataEntity.GenerateRowKey(address)));
 }