// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { InjetorDependencia.Register(services); services.AddDbContext <ContextoBD>(o => o.UseSqlServer(Configuration.GetConnectionString("SuperoBD"))); services.AddCors(o => { o.AddPolicy("default", builder => builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()); }); services.AddMvc(); services.AddSwaggerGen(o => { o.SwaggerDoc("v1", new Info { Title = "Supero Teste", Version = "v1" }); }); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { InjetorDependencia.RegistrarServicos(services); InjetorDependencia.ConfigurarComponentesSeguranca(services, Configuration); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); }
/// <summary> /// Inicialização do injetor de dependencia /// </summary> public static void Initialize() { InjetorDependencia.Inicializar(); InjetorDependencia.RegistrarControllers(GlobalConfiguration.Configuration); GlobalConfiguration.Configuration.DependencyResolver = InjetorDependencia.Resolver(); }
public static void Agendar(string timeZone, string cronCode) { var processamentoOrdemCompra = InjetorDependencia.ObterServicos <IProcesssaOrdemCompraSolicitada>(); TimeZoneInfo southZone = TimeZoneInfo.FindSystemTimeZoneById(timeZone); RecurringJob.AddOrUpdate(() => processamentoOrdemCompra.Processar(), cronCode, southZone); }
public void ConfigureServices(IServiceCollection services) { InjetorDependencia.Register(services); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSwaggerGen(envolti => { envolti.SwaggerDoc("v1.0.0", new Microsoft.OpenApi.Models.OpenApiInfo { Title = "Envolti Juros API", Version = "v1.0.0" }); }); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { Thread.CurrentThread.CurrentCulture = new CultureInfo("pt-BR"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("pt-BR"); InjetorDependencia.RegistrarServicos(services); InjetorDependencia.ConfigurarComponentesSeguranca(services, Configuration); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); var configConexao = InjetorDependencia.ObterServicos <ConfiguracaoConexao>(); services.AddHangfire(x => x.UseSqlServerStorage(configConexao.conexaoHangFire)); services.AddHangfireServer(); }
void IniciarServicos() { IoC.Inicializar(InjetorDependencia.Instancia()); }
public Startup(IConfiguration configuration) { Configuration = configuration; IoC.Inicializar(InjetorDependencia.Instancia()); }