-3

I encountered a problem, I thought a lot, I did not get anywhere. I have a table in the database called ticket, which contains the tickets and the answer to the tickets. I proceed with the repository model. I wrote a function that takes the ticket ID and extracts the text. NullReferenceException gives an error when I try to get the value. If I tried with brakepoint, the value was sent. Even if I checked with if, it says the value was sent. enter image description here

  • Please add your code/data/error as text to your question (and pay attention to [code formatting](https://meta.stackoverflow.com/questions/251361/how-do-i-format-my-code-blocks)). There are [many good reasons](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557), why images of code are not a good idea. – jps Oct 24 '21 at 08:58
  • We cant debug a story – TheGeneral Oct 24 '21 at 09:01

1 Answers1

-2

Your view model property is null. That's why Answer.AnswerText cause a NullReferenceException because Answer is null.

MrMoeinM
  • 2,080
  • 1
  • 11
  • 16