Question: The line price = co?.price ?? 0,
in the following code gives me the above error. but if I remove ?
from co.?
Jon Skeet's answer was right, in my case I was using DateTime
for my Entity class.
When I tried to use like
(a.DateProperty == null ? default : a.DateProperty.Date)
I had the error
Property 'System.DateTime Date' is not defined for type 'System.Nullable`1[System.DateTime]' (Parameter 'property')
So I needed to change DateTime?
for my entity class and
(a.DateProperty == null ? default : a.DateProperty.Value.Date)