We can use the System.Linq namespace to convert ICollection<T> to List<T> as dsiplays below.
//class definitions
public class Students
{
public ICollection<Courses> Courses{get;set;}
}
public class Courses
{
public ICollection<Students> Students{get;set;}
}
//end class definition
//create the List
using System.Linq;
List<Students> listOfStudents= lstStudents.OfType<Students>().ToList();
cheers,
Samitha
No comments:
Post a Comment