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); }
public Task SetStatus(string address, ReportStatus status) { return(_storage.ReplaceAsync(BaseReportMetadataEntity.GeneratePartitionKey(), BaseReportMetadataEntity.GenerateRowKey(address), p => { p.Status = status.ToString(); return p; })); }
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; })); }
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; })); }
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; })); }
public async Task <IBaseReportMetadata> Get(string address) { return(await _storage.GetDataAsync(BaseReportMetadataEntity.GeneratePartitionKey(), BaseReportMetadataEntity.GenerateRowKey(address))); }