Ramco Ramco

Ramco Ramco

  • 438
  • 3.4k
  • 542.7k

How to pass empty value to list

Apr 7 2023 5:56 AM

Hi

  How  i should pass value to List<string> Students so that it should return all students

public List<View_SessionDeliveryParticipant_Detailed_Report> GetSessionDeliveryParticipantList(DateTime frDate, DateTime toDate, List<string> Student, )
{
    List<View_SessionDeliveryParticipant_Detailed_Report> Result = (from t in context.View_SessionDeliveryParticipant_Detailed_Reports
                                                                    where t.SessionDate.Value.Date >= frDate.Date && t.SessionDate.Value.Date <= toDate.Date
                                                                    && (Student.Count != 0 ? Student.Contains(t.StudentID.ToString()) : 1 == 1)
                                                                    
                                                                    orderby t.SessionDate ascending
                                                                    select t).ToList();
    return Result;
}

Thanks


Answers (3)