📜  如何在 c# 代码示例中的 linq 查询中使用 distinct

📅  最后修改于: 2022-03-11 14:48:38.751000             🧑  作者: Mango

代码示例4
public static IQueryable GetDistinctProdType(
    this IQueryable query,
    int categoryId)
{
    return (from p in query
            where p.CatID == categoryId
            select p.Type).Distinct();
}