Say we have a class,
public class Student { private String name; private string course; public string Name { get { return name; } set { name = value; } } public string Course { get { return course; } set { course = value; } } public Student(string name, string course) { this.name = name; this.course = course; } }
And,
List<Student> list = new List<Student>() { new Student("a","course"), new Student("b","course1"), new Student("c","course2"), new Student("d","course3"), new Student("e","course4") };
To use LINQ,
IQueryable<Student> StudentEntity = list.AsQueryable<Student>(); string studentName = (from s in StudentEntity where s.Course == "course1" select s).First().Name; Console.WriteLine("Studnet Name : {0}", studentName);
The catch is that we convert the generic list to IQueryable<T> type which enables us to query against objects





Hi I have fallowing xelement
i want to retrive inner conetent of Sap how can i retrive the o/p as xlement?