コード例 #1
0
        public static void Main(string[] args)
        {
            var host = CreateHostBuilder(args).Build();

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;

                try
                {
                    InitializeData.InitializeTeams(services);
                    InitializeData.InitializePlayers(services);
                }
                catch (System.Exception)
                {
                    CreateHostBuilder(args).Build().Run();
                }
            }

            host.Run();
        }