private async Task _UpdateFileAnalysisAsync(string fileId, string hash, string results) { var analysis = await _dbContext.FileAnalysis.SingleOrDefaultAsync(fa => fa.FileId == fileId); if (null == analysis) { analysis = new FileAnalysis { FileId = fileId, Hash = hash, Results = results }; await _dbContext.AddAsync(analysis); } else { analysis.Hash = hash; analysis.Results = results; } await _dbContext.SaveChangesAsync(); await _notificationService.NotifyAsync <FileAnalyzerNotification>( FileAnalyzerNotifications.Completed, new FileAnalyzerNotification { FileId = fileId, Hash = hash }); }
public async Task AddAsync(string source, string destination) => await _context.AddAsync(source, destination);