using Bitget_Server.EFCore; using Microsoft.EntityFrameworkCore; using System.Net; namespace Bitget_Server { public class Program { public static void Main(string[] args) { var builder = WebApplication.CreateBuilder(args); builder.Services.AddDbContext(); builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddControllersWithViews(); var app = builder.Build(); using (var scope = app.Services.CreateScope()) { var services = scope.ServiceProvider; var context = services.GetRequiredService(); context.Database.Migrate(); } app.UseSwagger(); app.UseSwaggerUI(); app.MapControllers(); app.MapGet("/", () => "Hello World!"); app.Run($"http://{IPAddress.Any}:{5045}"); } } }