var Task1= myRepo.GetList1(data);
var Task2 = myRepo.GetList2(data);
await Task.WhenAll(Task1, Task2 );
This line throws an Exception below
The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
What is the reson for this Exception and how to overcome that?
Prasad RaveendranPosted Aug 31, 2023, 12:00 AM
The error message you're encountering seems to be related to JSON parsing. The error message suggests that the input provided to the JSON parser does not begin with a valid JSON token when the parser is expecting one. JSON tokens are fundamental units of JSON syntax, such as strings, numbers, objects, arrays, etc.
It's difficult to determine the exact cause of the error. However, based on the code snippet you've shared, it's possible that the error is occurring within the methods
myRepo.GetList1ormyRepo.GetList2. These methods might be attempting to parse JSON data but are receiving invalid input or no input at all, causing the JSON parser to fail.