public FileDownloadModel Download(int?id)
        {
            var file = mapper.Map <FileDTO>(database.Files.Get(id).Result);

            if (file != null)
            {
                return(FileManagment.DownloadFile(file));
            }
            throw new UserServiceException("File is null");
        }
Esempio n. 2
0
        public FileDownloadModel Download(string link)
        {
            var id   = database.Links.Get(x => x.Code == link).Result.Id;
            var file = mapper.Map <FileDTO>(database.Files.Get(x => x.Link.Id == id).Result);

            if (file != null)
            {
                return(FileManagment.DownloadFile(file));
            }
            throw new LinkServiceException("File is null");
        }