Exemple #1
0
        public async Task <ZipFileContent> SaveFile(byte[] fileContet)
        {
            try
            {
                string decryptedContent = await Task.Run(() => _decryptionService.Decrypt(fileContet));

                ZipFileContent file = await Task.Run(() => _zipRepository.Add(new Models.ZipFileContent
                {
                    FileContent = decryptedContent,
                    CreatedDate = DateTime.Now
                }));

                return(file);
            }
            catch (Exception)
            {
                return(null);
            }
        }
 public ZipFileContent Add(ZipFileContent file)
 {
     _context.ZipFileContents.Add(file);
     _context.SaveChanges();
     return(file);
 }