コード例 #1
0
        public bool SetActiveLeague(UserLeague league)
        {
            var inactiveLeagues = _db.UserLeague.Where(x => x.UserId == league.UserId && x.LeagueId != league.LeagueId).ToList();

            inactiveLeagues.ForEach(a => a.ActiveFlag = false);
            _db.SaveChanges();

            league.ActiveFlag = true;
            _db.UserLeague.Update(league);

            return(Save());
        }
コード例 #2
0
 public bool Save()
 {
     return(_db.SaveChanges() >= 0 ? true : false);
 }