Add project files.
This commit is contained in:
37
HanyadikHetVan/Program.cs
Normal file
37
HanyadikHetVan/Program.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using HanyadikHetVan.Data;
|
||||
using IdentityServer4.Models;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HanyadikHetVan
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var secret = new Secret("cunci".Sha256());
|
||||
System.Console.WriteLine(secret.Value);
|
||||
|
||||
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
using (var scope = host.Services.CreateScope())
|
||||
{
|
||||
var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
await context.Database.MigrateAsync();
|
||||
}
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user