您不能(也应该不能)投影到映射的实体上。但是,您可以投影到匿名类型或DTO上:
public class ProductDTO{ public string Name { get; set; } // Other field you may need from the Product entity}您的方法将返回DTO的列表。
public List<ProductDTO> GetProducts(int categoryID){ return (from p in db.Products where p.CategoryID == categoryID select new ProductDTO { Name = p.Name }).ToList();}


