Esempio n. 1
0
        public async Task <IActionResult> GetPolicyById([FromQuery] int id)
        {
            var p = await _policyManager.GetPolicyById(id);

            if (p.Documents != null && p.Documents.Count > 0)
            {
                var document = p.Documents[0];


                string filePath = policyDocumentsFolder + p.Id.ToString() + "/PolicyDocument";

                var result = await _fileManager.RetreiveFile(filePath, document.FileType);

                document.Data = result;

                document.DataAsBase64 = Convert.ToBase64String(document.Data);
            }

            return(Ok(p));
        }