Exemple #1
0
 public Task SaveAs(string path)
 {
     return(Task.Run(() =>
     {
         var templatePath = Path.Combine(ExcelModelConstant.GetTemplatePath(env), FileName);
         _logger.Debug(templatePath);
         using (var p = new ExcelPackage(new FileInfo(templatePath)))
         {
             ComponiFile(p);
             p.SaveAs(new FileInfo(path));
         }
     }));
 }
Exemple #2
0
 public Task <byte[]> GetBytes()
 {
     return(Task.Run(() =>
     {
         var templatePath = Path.Combine(ExcelModelConstant.GetTemplatePath(env), FileName);
         _logger.Debug(templatePath);
         using (var p = new ExcelPackage(new FileInfo(templatePath)))
         {
             ComponiFile(p);
             return p.GetAsByteArray();
         }
     }));
 }