Map controllers to program.cs file.

http://localhost:5072/api/teams
This commit is contained in:
Kevin Matsubara 2025-04-14 12:52:02 +02:00
parent 4176958f17
commit f8d1ddd758

View File

@ -1,8 +1,12 @@
using EntityFrameworkCore.Data; using EntityFrameworkCore.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using EntityFrameworkCore.API.Controllers;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
// Add services to the container. // Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi(); builder.Services.AddOpenApi();
@ -36,5 +40,6 @@ if (app.Environment.IsDevelopment())
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.MapControllers();
app.Run(); app.Run();