public static IExcelExportService GetExcelExportService(SolutionEnum solutionEnum = SolutionEnum.NPOI) { switch (solutionEnum) { case SolutionEnum.NPOI: return(new ExcelExportService(new ExcelExportProvider())); default: throw new NotImplementedException(); } }
public static IServiceCollection UseEasyOffice(this IServiceCollection services, SolutionEnum solutionEnum) { switch (solutionEnum) { case SolutionEnum.NPOI: services.AddTransient <IWordExportProvider, WordExportProvider>(); services.AddTransient <IExcelImportProvider, ExcelImportProvider>(); services.AddTransient <IExcelExportProvider, ExcelExportProvider>(); break; default: throw new NotImplementedException(); } services.AddTransient <IWordExportService, WordExportService>(); services.AddTransient <IExcelImportService, ExcelImportService>(); services.AddTransient <IExcelExportService, ExcelExportService>(); return(services); }