Ramco Ramco

Ramco Ramco

  • 452
  • 2.8k
  • 400.3k

Combine the results of 2 Linq queries & Bind to Repeater

Jun 15 2023 3:49 PM

Hi

   I want to Bind 2 Linq queries & then Bind To Repeater

public List<View_SessionDeliveryCalendarDetails_Student> GetSessionToJoin(Int32 StudentID, String EntriesType)
{
    List<View_SessionDeliveryCalendarDetails_Student> Result = (from t in context.View_SessionDeliveryCalendarDetails_Students
                                                                where t.StudentID == StudentID
                                                                && (EntriesType == "Completed" ? t.CurrentStatus != "Due" && t.ParticipationID != 0 : t.CurrentStatus == "Due")
                                                                && (EntriesType == "Today" ? t.SessionDate == DateTime.Now.Date && t.ActiveParticipant == true : 1 == 1)
                                                                && (EntriesType == "Upcoming" ? t.SessionDate > DateTime.Now.Date && t.ActiveParticipant == true : 1 == 1)

                                                                orderby t.SessionDate
                                                                select t).ToList();
    return Result;
}

public List<View_BookDeliveryDetail> GetFreeTrialSessionToJoin(Int32 StudentID)
{
    List<View_BookDeliveryDetail> Result = (from t in context.View_BookDeliveryDetails
                                                                where t.StudentID == StudentID

                                                                select t).ToList();
    return Result;
}

Thanks


Answers (3)