public async Task <IActionResult> OnGetDownloadFile(Guid Id)
        {
            Result = getCaseDetailsQuery.Execute(Id);
            if (Path.GetFileName(Result.CaseAttachment) == null)
            {
                return(Content("filename not present"));
            }
            var types = getMimeType.Get();
            var ext   = Path.GetExtension(Result.CaseAttachment).ToLowerInvariant();

            MimeType = types[ext];

            var memory = new MemoryStream();

            using (var stream = new FileStream(Result.CaseAttachment, FileMode.Open))
            {
                await stream.CopyToAsync(memory);
            }
            memory.Position = 0;
            return(File(memory, MimeType, Path.GetFileName(Result.CaseAttachment)));
        }
 public void OnGet(Guid Id)
 {
     Result = getCaseDetailsQuery.Execute(Id);
 }