How to handle null values in linq?
问题 recordsList.ListOfRecords = new StudentRecordsBAL() .GetStudentsList() .Select(q => new StudentRecords() { _RollNumber = q._RollNumber, _Class = q._Class, _Name = q._Name, _Address = q._Address, _City = q._City, _State = q._State, _Subjects = q._Subject, _AttendedDays = new AttendanceBAL() .GetAttendanceListOf(q._RollNumber) .Where(date => date != null) .Select(date => new DateTime(date._Date.Year, date._Date.Month, date._Date.Day)) .Distinct() .ToList(), _AttendedSubjects =