3
Answers

Error - Cannot implicitly convert Anonymous type to generic list

Photo of Ramco Ramco

Ramco Ramco

2y
1.2k
1

Hi

  On below code i am getting above error

public List<View_SessionDeliveryCalendarDetails_Student> GetOrderingInput()
        {
            List<View_SessionDeliveryCalendarDetails_Student> Result = (from t in context.View_SessionDeliveryCalendarDetails_Students
                                                        join t2 in context.View_BookDeliveryDetails
                                                        on new { p1 = (int)t.BookID, p2 = (int)t.StudentID} equals new { p1 = (int)t2.BookID, p2 = (int)t2.StudentID }
                                                        where t.CurrentStatus == "Due"
                                                        orderby t.Name
                                                        select new {t.Name,t2.AURL }).ToList();
             return Result;
        }

Answers (3)