コード例 #1
0
        public bool UpdateTeam(Team t)
        {
            Team team = GetTeamById(t.Id);

            if (team == null)
            {
                return(false);
            }
            ctx.Attach(t).State = EntityState.Modified;
            ctx.SaveChanges();
            return(true);
        }
コード例 #2
0
        public bool UpdatePlayer(Player p)
        {
            Player player = GetPlayerById(p.Id);

            if (player == null)
            {
                return(false);
            }
            ctx.Attach(p).State = EntityState.Modified;
            ctx.SaveChanges();
            return(true);
        }