title: Check null condition for string date conversion to DateTime inside object
body: <p>I am assigning values to class object in loop and apparently I am getting error due to date null value.</p>
  
  <p>My question is can I use LINQ to check value inside object </p>
  
  <pre><code>foreach (var item in _query)
  {
      EnrolmentList.Add(new EnrolmentEntity
      {
          PeopleUnitsID = item.PeopleUnitsID,
          PersonCode = item.PersonCode,
          UnitType = item.UnitType,
          ProgressCode = item.ProgressCode,
          ProgressStatus = item.ProgressStatus,
          ProgressDate = Convert.ToDateTime(item.ProgressDate),
          UnitInstanceID = item.UnitInstanceID,
          UnitInstanceOccurrenceID = item.UnitInstanceOccurrenceID,
          CourseCode = item.CourseCode,
          OwningOrganisation = item.OwningOrganisation,
          CalendarOccurrenceCode = item.CalendarOccurrenceCode,
          FES_Start_Date = Convert.ToDateTime(item.FES_Start_Date),
          AimStartDate = Convert.ToDateTime(item.AimStartDate)
      });
  }
  </code></pre>
  
  <p>there are three date variable that I need to check if they are null or not. If null then I need to ignore that rather then to convert them to date</p>