I have the below linq currently working, but what I would really like is to return an ICollection<SexyPeopleVM>
instead of a list. But I can't get my head around the syntax and other alternative I've tried have failed at runtime.
Is this possible? How can I achieve this?
var o = from s in sexyPeople
select new SexyPeopleVM()
{
id = s.ID,
title = s.Title,
views = s.Views,
url = s.GetFullyQualifiedURL(),
friendlyDate = s.DateCreated.AsShortFriendly()
};
List<SexyPeopleVM> list = o.ToList();
return list;