private async Task SaveIntoDatabase(AudioUploadDto uploadDto, CancellationToken ct) { var audioModel = new Audio { OwnerId = uploadDto.PublisherId, Path = uploadDto.Path, Meta = _tagsProvider.GetTags(uploadDto.Path), UtcCreatedTime = _dateTimeWrapper.UtcNow }; await _audioEntriesRepository.AddAsync(audioModel, ct); await _audioEntriesRepository.SaveAsync(ct); }
private async Task SaveToLocalFolder(AudioUploadDto uploadDto, CancellationToken ct) { await _localAudioRepository.AddAsync(uploadDto, ct); }
public async Task UploadAudioAsync(AudioUploadDto uploadDto, CancellationToken ct) { uploadDto.Path = _pathProvider.BuildPath(uploadDto.File.FileName); await SaveToLocalFolder(uploadDto, ct); await SaveIntoDatabase(uploadDto, ct); }