无法在LINQto实体查询中构造实体
public IQueryable<Product> GetProducts(int categoryID){ return from p in db.Products where p.CategoryID== categoryID select new Product { Name = p.Name};}
“实体或复杂类型的Shop.Product不能在LINQtoEntites查询中构建”
var products = productRepository.GetProducts(1).Tolist();
select p
select new Product { Name = p.Name};
jeck猫