public async Task <IActionResult> PollutionCertDownload(string carreg) { PollutionDto response = null; string res = string.Empty; var temp = await carDetailsBusinessLogic.PollutionCertDownloadAsync(carreg); if (temp != null) { response = temp; } else { return(Ok("Download Link expire or you have not submit the Request")); } return(Ok(response)); }
/// <summary> /// Method to Download Report for Polluction Certificate after requesting /// </summary> /// <param name="carReg"></param> /// <returns></returns> public async Task <PollutionDto> PollutionCertDownloadAsync(string carReg) { PollutionDto response = null; var caheData = _cache.Get(carReg); await Task.Run(() => { if (caheData != null) { foreach (var data in caheData.TestData) { if (data.CarRegNumber.Equals(carReg)) { response = data.Pollution; } } } }); return(response); }