Example #1
0
        public FUTClub AddPlayerToClub(FUTClub club, int playerid)
        {
            Player playerToAdd = Player.GetById(playerid.ToString());
            var    filter      = Query <FUTClub> .EQ(q => q.name, club.name);

            var update = Update.Push("players", playerToAdd.ToBson());

            _db.GetCollection <FUTClub>("clubs").Update(filter, update);
            club.players.Add(playerToAdd);
            return(club);
        }
Example #2
0
 public FUTClub Create(FUTClub c)
 {
     _db.GetCollection <FUTClub>("clubs").Save(c);
     return(c);
 }