コード例 #1
0
ファイル: ServiceFactory.cs プロジェクト: ywscr/EasyOffice-1
        public static IExcelExportService GetExcelExportService(SolutionEnum solutionEnum = SolutionEnum.NPOI)
        {
            switch (solutionEnum)
            {
            case SolutionEnum.NPOI:
                return(new ExcelExportService(new ExcelExportProvider()));

            default:
                throw new NotImplementedException();
            }
        }
コード例 #2
0
        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);
        }