I'm at a standstill, how can I fix this? In the ProductAvailability table in my query there is no record for each product found, and every time I start it, the following error occurs.
An argument of type "DateTime" failed because the materialized value is null. Either the general parameter of the result type, or the query should use a type with a null value.
How to fix this error? I tried casting paj.DateAvailable (DateTime?), And also checked null, but this does not seem to fix the problem. Hmm?
Here is my request. Any ideas?
var query = (from p in entities.Products
join pa in entities.ProductAvailabilities on p.ProductId equals pa.ProductId into joinProductAvailabilities
from paj in joinProductAvailabilities.DefaultIfEmpty()
where ps.IsActive
select new { ProductId = p.ProductId, DateAvailable = paj.DateAvailable }).Distinct();
user297691
source
share