Files
BitGet_API/Bitget_Server/Program.cs

28 lines
698 B
C#
Raw Normal View History

2024-06-02 19:32:08 +09:00
using Bitget_Server.EFCore;
using Microsoft.EntityFrameworkCore;
namespace Bitget_Server
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<BitgetContext>();
var app = builder.Build();
using (var scope = app.Services.CreateScope())
{
var services = scope.ServiceProvider;
var context = services.GetRequiredService<BitgetContext>();
context.Database.Migrate();
}
app.MapGet("/", () => "Hello World!");
app.Run();
}
}
}