1
저는 LINQ를 처음 사용하기 때문에 변환에 몇 가지 문제가 있습니다. 마지막 이름 앞에 알파벳순으로 이름이있는 모든 학생을 찾는 방법을 작성해야합니다.LINQ 변환 문제
static Student[] FindAllFirstNameBeforeSecond(Student[] students)
{
Student[] newStudents =
from student in students
where student.FirstName.CompareTo(student.LastName) < 0
select student;
return newStudents;
}
나는이 오류 받고 있어요 :
Cannot implicitly convert type
'System.Collections.Generic.IEnumerable<ConsoleApplication2.Student>'
to 'ConsoleApplication2.Student[]'.
An explicit conversion exists (are you missing a cast?)
가 내가 뭘 잘못에 대한 몇 가지 도움말을 얻을 수를 여기 내 코드는?
네, 작동합니다. 도와 주셔서 감사합니다 ! –