예제 #1
0
        public async Task <DlBook> GetLatestDlBookDetail(UserCredential userCredential, string deviceId, int bookId, CancellationToken cancelToken)
        {
            var downloadValidation = await deliveryService.DlFileDetailByDlId(userCredential.Email, deviceId, bookId, cancelToken);

            if (!downloadValidation.IsSuccess)
            {
                throw new Exception("downloadValidate failure");
            }
            var serverDlBook = JsonConvert.DeserializeObject <DlBook>(downloadValidation.Content);

            if (serverDlBook != null)
            {
                serverDlBook.ServiceCode = userCredential.ServiceCode;
                serverDlBook.Email       = userCredential.Email;
            }
            else
            {
                throw new NullReferenceException();
            }
            return(serverDlBook);
        }