Wähle von der Dropdown-Liste, um den Text zu vervollständigen.
A company develops a series of mobile games. All games use a single leaderboard service.
You have the following requirements:
✑ Code must be scalable and allow for growth.
✑ Each record must consist of a playerId, gameId, score, and time played.
✑ When users reach a new high score, the system will save the new score using the SaveScore function below.
Each game is assigned an Id based on the series title.
You plan to store customer information in Azure Cosmos DB. The following data already exists in the database:
PartitionKey || RowKey || Email
Harp || Walter || wharp@contoso.com
Smith || Steve || ssmith@contoso.com
Smith || Jeff || jsmith@contoso.com
You develop the following code to save scores in the data store. (Line numbers are included for reference only.)
01 public void SaveScore(string gameId, string playerId, int score, long timePlayed)
02 {
03 CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
04 CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
05 CloudTable table = tableClient.GetTableReference("scoreTable");
06 table.CreateIfNotExists();
07 var scoreRecord = new PlayerScore(gameId, playerId, score, timePlayed);
08 TableOperation insertOperation = TableOperation.Insert(scoreRecord);
09 table.Execute(insertOperation);
10 }
You develop the following code to query the database. (Line numbers are included for reference only.)
01 CloudTableClient tableClient = account.CreateCloudTableClient();
02 CloudTable table = tableClient.GetTableReference("people");
03 TableQuery<CustomerEntity> query = new TableQuery<CustomerEntity>()
04 .Where(TableQuery.CombineFilters(
05 TableQuery.GenerateFilterCondition(PartitionKey, QueryComparisons.Equal, "Smith"),
06 TableOperators.And, TableQuery.GenerateFilterCondition(Email, QueryComparisons.Equal, "ssmith@contoso.com")
07 ));
08 await table.ExecuteQuerySegmentedAsync<CustomerEntity>(query, null);
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Answer Area:
Statements || Bool
SaveScore will wirk with Cosmos DB. || ( Yes, No )
SaveScore will update and replace a record if one already exists with the same playerId and gameId || ( Yes, No )
Leader board data for the game will be automatically partitioned using gameId. || ( Yes, No )
SaveScore will store the values for the gameId and playerId parameters in the database. || ( Yes, No )