public static void ExportPlayerToPDF(int playerId)
        {
            SqlServerFootballDbContext dbcontext = new SqlServerFootballDbContext();

            var selection = dbcontext.Players.Where(x => x.Id == playerId)
                            .Select(x => new
            {
                Name        = x.Name,
                Age         = x.Age,
                Nationality = x.Nationality,
                Salary      = x.Salary,
                Contract    = x.Contract,
                Team        = x.Team
            })
                            .ToArray();

            Player player = new Player()
            {
                Name        = selection[0].Name,
                Age         = selection[0].Age,
                Nationality = selection[0].Nationality,
                Salary      = selection[0].Salary,
                Contract    = selection[0].Contract,
                Team        = selection[0].Team
            };

            CreatePDF(player, playerId);
        }
        public void AddOwners(SqlServerFootballDbContext context, Owner[] trainers)
        {
            for (int i = 0; i < trainers.Length; i++)
            {
                context.Owners.Add(owners[i]);
            }

            context.SaveChanges();
        }
        public void AddPlayers(SqlServerFootballDbContext context, Player[] players)
        {
            for (int i = 0; i < players.Length; i++)
            {
                context.Players.Add(players[i]);
            }

            context.SaveChanges();
        }
        public void AddTeams(SqlServerFootballDbContext context, Team[] teams)
        {
            for (int i = 0; i < teams.Length; i++)
            {
                context.Teams.Add(teams[i]);
            }

            context.SaveChanges();
        }
        public void AddTowns(SqlServerFootballDbContext context, Town[] towns)
        {
            for (int i = 0; i < towns.Length; i++)
            {
                context.Towns.Add(towns[i]);
            }

            context.SaveChanges();
        }
        public void AddCountries(SqlServerFootballDbContext context, Country[] countries)
        {
            for (int i = 0; i < countries.Length; i++)
            {
                context.Countries.Add(countries[i]);
            }

            context.SaveChanges();
        }
 public DataWriter(SqlServerFootballDbContext context)
 {
     this.DbContext = context;
     this.ReadData();
 }
 public Engine()
 {
     this.context    = new SqlServerFootballDbContext();
     this.dataWriter = new DataWriter(this.context);
 }