I have List<Student> with multiple records
public class Student
{
public int? StudentId { get; set; }
public string StudentName { get; set; }
public int? AttendanceStatusId { get; set; }
public string AttendanceStatusDes { get; set; }
}
While posting data to server, sometimes AttendanceStatusId & AttendanceStatusDes going null.
When these 2 values are null in List records, I want to set AttendanceStatusId=1 & AttendanceStatusDes="Present"
How could I do that using Linq query.
Thank you
nullreturn 1 in the getter ofAttendanceStatusId.