csharp中FirstOrDefault()也会返回null

c#中FirstOrDefault()也会返回null

List<string> list = new List<string>();
> list.Add(“a”);
> list.Add(“b”);
> list
List<string>(2) { “a”, “b” }
> list.Where(p=>p == “a”).FirstOrDefault()
“a”
> list.Where(p=>p == “aaa”).FirstOrDefault()
null