tags:

views:

29

answers:

0

How can I convert this query

return (IList)(from s in modelObject.BC_mountainResortMediaList
               select new
               {
                   mountainId = s.mountainResortId,
                   mountainName = s.mountainResortName,
               })
              .ToList();

into this query

IEnumerable<BC_mountainResortMediaList> itemList =
           from item in modelObject.BC_mountainResortMediaList
           select new BC_mountainResortMediaList
           {

               mountainName = item.mountainResortName,
               mountainId = item.mountainResortId,
               Selected = (item.Key == "TheKeyYouWantToSet")
           };

Please help and how shall I call it in the controller