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 virtual Task InsertOrReplace(IBaseReportMetadata reportMetadata)
 {
     return(_storage.InsertOrReplaceAsync(BaseReportMetadataEntity.Create(reportMetadata)));
 }
コード例 #7
0
 public async Task <IEnumerable <IBaseReportMetadata> > GetAll()
 {
     return(await _storage.GetDataAsync(BaseReportMetadataEntity.GeneratePartitionKey()));
 }
コード例 #8
0
 public async Task <IBaseReportMetadata> Get(string address)
 {
     return(await _storage.GetDataAsync(BaseReportMetadataEntity.GeneratePartitionKey(),
                                        BaseReportMetadataEntity.GenerateRowKey(address)));
 }