コード例 #1
0
        public Task <HttpContent> StreamTrack(TrackStreamRequest request)
        {
            if (request is null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            if (request.ReleaseId == Guid.Empty)
            {
                throw new ArgumentException(nameof(TrackDownloadRequest.ReleaseId));
            }

            if (request.TrackId == Guid.Empty)
            {
                throw new ArgumentException(nameof(TrackDownloadRequest.TrackId));
            }

            return(_service.StreamTrack(request));
        }
コード例 #2
0
        public static async Task <Stream> StreamTrackAsStream(this IMonstercatApi api, TrackStreamRequest request)
        {
            var content = await api.StreamTrack(request).ConfigureAwait(false);

            return(await content.ReadAsStreamAsync().ConfigureAwait(false));
        }