📅  最后修改于: 2022-03-11 14:48:50.647000             🧑  作者: Mango
public static IQueryable DistinctBy(
this IQueryable source,
Expression> keySelector)
{
return source.GroupBy(keySelector).Select(grouping => grouping.FirstOrDefault());
}