Example #1
0
        public async Task <IActionResult> Product(Guid id)
        {
            var customerId = User.GetCustomerId();

            if (customerId.HasValue)
            {
                var result = await _downloadService.DownloadFullAsync(customerId.Value, id);

                if (result.Succeeded)
                {
                    var contract = result.Value;
                    return(File(contract.Data, contract.ContentType, contract.FileName));
                }
            }
            return(View("~/Views/Error/DownloadError.cshtml"));
        }