am accessing a class from my webservice as
[WebMethod(EnableSession = true)]
public string fetchAbsentees(string date)
{
string data = string.Empty;
StudentAttendances students = new StudentAttendances(date);
SearchStudents fetchStudents =new SearchStudents(students);
data = jsonSerialize.Serialize(fetchStudents);
}
return data;
}
when I execute this code am getting the values from the StudentAttendance class, I have StudentId property along with attendancestatus, date etc in the StudentAttendance class….
in the SearchStudentClass I have a constructor with one parameter(to accept the StudentId), my question is how can I get the StudentId alone from students and pass it to SearchStudents……..can anyone help me here
To get a list of ids from students using Linq
This will return an
IEnumerable<YourIDType>. If that’s what you’re passing toSearchStudents().Above, you mention that
SearchStudentsaccepts a singleStudentId, so in that case you’d need to iterate over each of the students returned byStudentAttendances(date).I don’t know what your
SearchStudentsclass looks like, nor what is returned byStudentAttendances(date)but you could iterate over each of the students returned by the latter, pass it in to the former, and aggregate the results before serializing to JSON.