Build with an Azure free account. Get USD200 credit for 30 days and 12 months of free services.

Start free today

This is how you get rid of null reference exceptions forever

Play This is how you get rid of null reference exceptions forever

The Discussion

  • User profile image
    Ajay Tandon

    This is brilliant. However, when I turned nullable on I got ‘sqlnullvalueexception Data is Null’ when using entity framework core and using ToList() on the iqueryable. The stack trace is not particularly helpful, unfortunately. This all works fine when I remove the nullable from the csproj file, and I have investigated the ‘required’, with no success. Any advice on how to handle this. Is EF Core compatible with nullable?

    Thanks in advance for any insights you can provide.

Add Your 2 Cents