// This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            FillAppConfig();
            services.AddMvc();

            services.AddTransient <IConsultaAcademicaService, ConsultaAcademicaService>((s) =>
            {
                var consultaAcademicaService = new ConsultaAcademicaService(AppConfig.ApiUrl)
                {
                    Token = AppConfig.Token
                };

                return(consultaAcademicaService);
            });

            services.AddTransient <ISincroniaService, SincroniaService>((s) =>
            {
                var sincroninaService = new SincroniaService(AppConfig.ApiUrl)
                {
                    Token = AppConfig.Token
                };

                return(sincroninaService);
            });
        }
Пример #2
0
        public ImportadorServiceController(AbstractServiceBuilder builder, AppConfiguration configuration)
        {
            ServiceBuilder           = builder;
            Configuration            = configuration;
            ConsultaAcademicaService = ServiceBuilder.GetService <ConsultaAcademicaService>("ConsultaAcademicaService");
            SincroniaService         = ServiceBuilder.GetService <SincroniaService>("SincroniaService");
            Modalidades = (Modalidade[])GetModalidades();

            CanLog         = false;
            UseParallelism = true;
        }