Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AgendamentoContexto contexto)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();

            app.UseCors(
                options => options.AllowAnyOrigin().AllowAnyMethod()
                );

            app.UseCors(options => {
                options.WithOrigins("http://localhost")
                .AllowCredentials()
                .AllowAnyMethod()
                .AllowAnyHeader();
            });

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            InicializaDB.Initialize(contexto);
        }
Ejemplo n.º 2
0
 public AgendamentoController(AgendamentoContexto context)
 {
     _context = context;
 }
 public FornecedorController(AgendamentoContexto context)
 {
     _context = context;
 }