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)); } })); }
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(); } })); }