// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { BookInjector.RegistrarServicos(services); services.AddCors(options => options.AddPolicy("AllowAll", p => p.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader())); services.AddControllers(); }
public void ConfigureServices(IServiceCollection services) { BookInjector.Main(services); services.AddCors(options => options.AddPolicy("AllowAll", p => p.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader())); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "Book Search API", Version = "v1" }); }); services.AddControllers(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { BookInjector.RegistrarServicos(services); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); }