この変換タイプのエラーを解決するにはどうすればよいですか?このタイプのエラーを解決する方法は?
が暗黙的にタイプを変換できません
'System.Collections.Generic.List' に 'エラー2System.Collections.Generic.List
暗黙的に変換できません。タイプ 'System.Collections.Generic.List<AnonymousType#1>
System.Collections.Generic.List<Product>
' に' ' D:\フォーチュン\にApp_Code \ BL \ StoreController.cs 204 45 D:\フォーチュン\
public static List<Product> GetProductsByCategoryID(int productCategoryId)
{
FortuneDataContext db = SiteController.GetNewFortuneDataContext();
List<Product> prods = (from p in db.Products
join pc in db.ProductCategories
on p.ProductCategoryId equals pc.ProductCategoryId
where pc.ParentProductCategoryId == productCategoryId
select new
{
p.ProductId,
p.ProductCategoryId,
pc.ParentProductCategoryId,
ProductName = p.Name,
Category = pc.Name,
p.Price,
p.ProductYear
}).ToList();
return prods;
}