How can we avoid null exceptions when using Lambda queries? In the below code when InstallationDateType
is null I get an exception. How do I tackle with this?
foreach (AvailableDate availableDate in installationDatesResponseRootObject.Response
.InstallationDatesResponse
.AvailableDates
.Where(a =>
a.InstallationDateType.ToString().ToUpper() == Constants.InstallationDateTypeDish))
{
//Do Something
}