bitget asp 서버 추가
This commit is contained in:
27
Bitget_Server/Program.cs
Normal file
27
Bitget_Server/Program.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user