0

在 LINQ 中使用 C# SQL,我遇到了以下语句:

var names = database.Browsers.Select(b => b.Name);

做什么b=>b.Name?运营商一般是做什么的=>

该代码是 C#.net 框架的一部分,其中数据库是通过 Linq 处理底层数据库的句柄。

4

1 回答 1

6

The => indicates the use of a lambda expression. In this case b is a reference to an instance of the Browser object, while the Select(b=> b.Name) will return an enumerable containing only the attribute Name.

于 2013-03-26T17:47:35.577 回答