which line is it happening on? which line is line 30?
I think the error is being thrown in GetPerson(), perhaps there isn’t a record where id=1 in the database?


I checked my database again just to be sure but there’s a record with ID 1
Line 30 is the beginning of my method. The public async Task
Are you instantiating the object when you’re fetching it? Or does the function return an object that’s instantiated at some point?
I’m instantiating the object when fetching it
If line 30 is the method signature, then it seems either context is null, or context.People is null.
How do I correct that then
Have you put a break point after asserting response isn’t null to see what you are actually getting. Most likely the Id for GetPerson is either returning an empty object or your response is not John
C# devs
null reference exceptions

source