Ramco Ramco

Ramco Ramco

  • 464
  • 2.8k
  • 402.4k

Conversion error

Oct 10 2022 6:47 AM

Hi

 Error - Cannot implicitly convert type system.linq.Iqueryable to system.collection.generic.list

public List<StudentDetail> GetStudentCurrent(Int32 StudentId)
{
    List<StudentDetail> Result = (from t in context.StudentDetails
                                  join t2 in context.Student
                                  on t.LoginCode equals t2.StudentID
                                  orderby t.StudentID,t.CreatedOn
                                  select t).Take(1);

    return Result;
}

Thanks


Answers (2)