private void MatchSessionEnd_Load(object sender, EventArgs e)
        {
            this.SetupForm(logger);
            try
            {
                var me = FSharpInterop.Interop.Database.GetIdentityPlayer(context);
                primaryPlayer = session.MatchSessions_Player.FirstOrDefault(p => p.Player == me);
                if (primaryPlayer == null)
                {
                    primaryPlayer = session.MatchSessions_Player.FirstOrDefault();
                    if (primaryPlayer == null)
                    {
                        primaryPlayer = new MatchSessions_Player(){Player = me, MyMatchSession = session};
                        playerTableCopy.Add(primaryPlayer);
                    }
                }
                tagTextBox.Text = session.MyTags;
                matchNameTextBox.Text = session.Name;
                if (!string.IsNullOrEmpty(session.EslMatchLink))
                {
                    linkLabel.Text = session.EslMatchLink;
                    linkLabel.Visible = true;
                }

                playerTableCopy.UserAddedRow += playerTableCopy_UserAddedRow;
                matchmediaBindingSource.DataSource = matchmediaTableCopy.SourceTable;
            }
            catch (Exception ex)
            {
                ex.ShowError(logger, "Could not load SessionEnd-View");
                Close();
            }
        }
 partial void DeleteMatchSessions_Player(MatchSessions_Player instance);
 partial void UpdateMatchSessions_Player(MatchSessions_Player instance);
 partial void InsertMatchSessions_Player(MatchSessions_Player instance);
		private void detach_MatchSessions_Player(MatchSessions_Player entity)
		{
			this.SendPropertyChanging();
			entity.Player = null;
		}
		private void attach_MatchSessions_Player(MatchSessions_Player entity)
		{
			this.SendPropertyChanging();
			entity.MatchSession = this;
		}
        private void RefreshMatchmediaView()
        {
            var matchSessionsPlayers = GetSelectedPlayers();
            primaryPlayer = matchSessionsPlayers.Item2 != null ? matchSessionsPlayers.Item2.Original : null;
            var changedPrimaryPlayer = matchSessionsPlayers.Item2 != null ? matchSessionsPlayers.Item2.Copy : null;
            primaryPlayerLabel.Text = changedPrimaryPlayer == null
                                          ? "None"
                                          : string.Format("{0} ({1})", changedPrimaryPlayer.Player.Name, changedPrimaryPlayer.Player.MyId);

            IEnumerable<Matchmedia> media = new Matchmedia[0];
            media = 
                matchSessionsPlayers.Item1
                    .Aggregate(media, (current, selectedPlayer) =>
                        current.Union(from copy in matchmediaDataCopy.CopyLinqData
                                      let orig = matchmediaDataCopy.get_CopyItemToOriginal(copy)
                                      where orig.MatchSessions_Player == selectedPlayer.Original
                                      select copy));

            var value = matchmediaDataCopy.GetCopiedTableFromCopyData(media);
            value.InitRow += value_InitRow;
            value.UserAddedRow += value_UserAddedRow;

            SetNewWrapper(value);
        }
        private bool ChangeCopyItem(Player player, MatchSessions_Player copyItem)
        {
            var changedCopyItem = false;
            if (string.IsNullOrEmpty(copyItem.Player.Name) || copyItem.Player.Name == "unknown")
            {
                copyItem.Player.Name = player.Name;
                changedCopyItem = true;
            }

            if (string.IsNullOrEmpty(copyItem.Player.MyTags))
            {
                copyItem.Player.MyTags = player.MyTags;
                changedCopyItem = true;
            }
            return changedCopyItem;
        }