Hi Maria Soledad Fernandez Oporto,
Thank you for reaching out to Microsoft Q & A forum.
The exercise instructs the use of System.Text.Json
for deserialization, but the provided code uses JsonConvert.DeserializeObject
, which is part of the Newtonsoft.Json
library. The correct approach for System.Text.Json
should be:
SalesData? data = JsonSerializer.Deserialize<SalesData?>(salesJson);
This discrepancy arises from the exercise referencing methods from Newtonsoft.Json
. Please modify the deserialization code to use JsonSerializer from System.Text.Json
to align with the exercise instructions.
We will forward this issue to our internal team for an update. An updated version of the code will be provided in the future to prevent any confusion and ensure a smoother experience.
Please feel free to contact us if you have any additional questions.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.