コード例 #1
0
        static void Main(string[] args)
        {
            ConfigurationService.Init();

            using (var playerDataAccess = new PlayerDataAccess())
            {
                foreach (var player in playerDataAccess.Select())
                {
                    Console.WriteLine($"[{player.Number}]{player.FullName}");
                }

                var teamDataAccess = new TeamDataAccess();

                var result = teamDataAccess.Select();

                playerDataAccess.Insert(new Player {
                    FullName = "Петя", Number = 5, TeamId = result.First().Id
                });

                teamDataAccess.Dispose();

                Console.WriteLine();

                foreach (var player in playerDataAccess.Select())
                {
                    Console.WriteLine($"[{player.Number}]{player.FullName}");
                }
            }
        }
コード例 #2
0
 private static void InitConfiguration()
 {
     ConfigurationService.Init();
 }