Exemplo n.º 1
0
 public MemoryStream GetEmployeePicture(Guid employeeId)
 {
     try
     {
         MemoryStream pictureStream = new MemoryStream();
         binaryFiles.DownloadToStreamByName(employeeId.ToString(), pictureStream);
         return(pictureStream);
     }
     catch (GridFSFileNotFoundException)
     {
         return(null);
     }
 }
Exemplo n.º 2
0
        public void GetFile(string fileName, Stream destination)
        {
            if (fileName == null)
            {
                throw new ArgumentNullException(nameof(fileName));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            _gridFsBucket.DownloadToStreamByName(fileName, destination);
        }