sorry if my english is not good.
I am working in a view to do a search, I am using JSon to do the query,
When I get the data from the database using the next JSON:
Json(db.CertificationHeaders.ToList().Join(db.CertificationDetails, c =>
c.HeaderCertificationID, cd => cd.HeaderCertificationID, (c, cd) => new { c,
cd })
.Where((d => (d.c.PlanID.ToString().Contains(planID)) &&
d.cd.InternalConsecutive.Contains(internalConsecutive) ||
d.cd.SecurityConsecutive.Contains(securityConsecutive) ||
d.c.RequestDate.Value.Year.ToString().Contains(year) ||
d.c.DateGrant.Contains(grantDate)))
everything goes well untill this part of the code:
d.cd.SecurityConsecutive.Contains(securityConsecutive)
when the info from the data base comes "null" I get a
NullReferenceExeption
I have been doing a research and the information says that this error comes when a value from database is null,so the question is: how can I avoid it?