views:

113

answers:

1

I am trying to do this on a method which is basically a mapper - maps old categories List to a new List. The OldCategory has fewer properties.

return categories = from c in oldCategories select new Category 
{  
CategoryName = c.CategoryName, 
Id = c.CategoryId, 
Teams = CombineTeam(c.Team, coreTeam)
};

Why can't I use CombineTeam method in the expression? Help appreciated. Thanks

UPDATE: not working because c.Team is IQueryable and CombineTeam methods takes a List

Anyone can help me convert to List from IQueryable within the expression;

A: 
return categories = from c in oldCategories select new Category 
{  
CategoryName = c.CategoryName, 
Id = c.CategoryId, 
Teams = CombineTeam(c.Team.ToList(), coreTeam)
};
jchapa
Thanks, it works
eb