public async Task<ArchiveResult> PerformArchive(string scanDirectory, string target) { if (_started) throw new InvalidOperationException("Archiver was already started"); _started = true; _result = await Task.Run<ArchiveResult>(() => this.Archive(scanDirectory, target)); return _result; }
public async Task <ArchiveResult> PerformArchive(string scanDirectory, string target) { if (_started) { throw new InvalidOperationException("Archiver was already started"); } _started = true; _result = await Task.Run <ArchiveResult>(() => this.Archive(scanDirectory, target)); return(_result); }