Reading and updating an existing document with a POCO
Now we will write a method that updates a persisted Competition
instance that represents a competition that is scheduled. Specifically, the method changes the values for the DateTime
, NumberOfRegisteredCompetitors
, and Platforms
properties.
The following lines declare the code for the UpdateScheduledCompetitionWithPlatforms
asynchronous static method, which receives the competition id
, its location zip code, the new date and time, the new number of registered competitors, and the new gaming platforms in the competitionId
, competitionLocationZipCode
, newDataTime
, newNumberOfRegisteredCompetitors
, and newGamingPlatforms
arguments. The method retrieves the Competition
 instance whose ID matches the competitionId
value received as an argument, and updates the values to the explained properties. Add the following lines to the existing code of the Program.cs
file. The code file for the sample is included in the learning_cosmos_db_05_01
folder...