Exemplo n.º 1
0
        public void DeletePlayer(Player player)
        {
            var dc = new AuctionTrackerContext();

            dc.Players.Attach(player);
            dc.Entry <Player>(player).State = System.Data.Entity.EntityState.Deleted;
            dc.SaveChanges();
            Clients.All.playerDeleted(player);
        }
Exemplo n.º 2
0
        public void UpdatePlayer(Player player, int originalTeamId)
        {
            var dc = new AuctionTrackerContext();

            dc.Players.Attach(player);
            dc.Entry <Player>(player).State = System.Data.Entity.EntityState.Modified;
            dc.SaveChanges();
            player.TeamName = dc.Teams.Single(t => t.ID == player.TeamID).Name;

            Clients.All.playerUpdated(player, originalTeamId);
        }