📜  .netstandard distinctby iqueryable - C# 代码示例

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

代码示例1
public static IQueryable DistinctBy(
    this IQueryable source,
    Expression> keySelector)
    {
        return source.GroupBy(keySelector).Select(grouping => grouping.FirstOrDefault());
    }