public async Task <string> InsertEngine(QuantumChessEngine engine) { var game = new Game(ObjectId.GenerateNewId(), engine); await ActiveGames_.InsertOneAsync(ChessBsonSerializationUtils.Serialize(game)); return(game.Id.ToString()); }
public async Task UpdateEngine(string gameId, QuantumChessEngine engine) { var replacement = new Game(new ObjectId(gameId), engine); await ActiveGames_.FindOneAndReplaceAsync(FilterById(gameId), ChessBsonSerializationUtils.Serialize(replacement)); }