class Program
{
static void Main()
{
var list = new List<Foo>();
var a = list.All(l => l.BoolBar == true);//true
var s = list.All(l => l.Bar.Contains("magicstring"));//true
}
}
public class Foo
{
public bool BoolBar{ get; set; }
public string Bar{ get; set; }
}
Based on this snippet I'm wondering why Linq framework creators chose to go with this solution for empty collections? Also, due Visual Studio and Linq are both MS products why intellisense does not warn if a user didn't check whether the collection is empty before performing .All? I think it can cause a lot of unexpected results.