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); }
public FUTClub Create(FUTClub c) { _db.GetCollection <FUTClub>("clubs").Save(c); return(c); }