【发布时间】:2019-04-25 06:56:40
【问题描述】:
我想知道根据https://docs.microsoft.com/en-us/dotnet/csharp/discards,在 Linq 查询中使用 Discards 是否是一种很好的模式,例如:
public bool HasRedProduct => Products.Any(_=>_.IsRed == true);
什么是优点/缺点,而不是使用
public bool HasRedProduct => Products.Any(x=>x.IsRed == true);
【问题讨论】: