I have a linq to sql which creates a list of object
List<Student> Student= playerpoints.AsEnumerable()
.GroupBy(r => new { Name = r.Field<string>("ID"), Action = r.Field<string>("Name") })
.Select(grp => new Student
{
AwardName = grp.Key.Action,
Count = grp.Count()
}).ToList();
and i am converting it into list of objects using snippet in this method
Student[] objects = list.ConvertAll<Student>(item => (Student)item).ToArray();
Is there a way i can directly do this?
I mean instead of converting to list and then to a object array can i directly populate the array of objects instead of the list of object??