LINQ非常酷

2005-09-16 by 开心就好

读完文档,I am in awe,虽然感觉这玩意带来的编程模型的变化会很大

对DLINQ的基于属性的做法

[Table(Name="Customers")]
public class Customer
{
 [Column(Id=true)]
 public string CustomerID;
 [Column]
 public string City;
}

不是很认同,因为这样把relational database schema与对象模型耦合在一起了,这也是我不喜欢Gentle.NET的原因

比较一下C#,VB的Query syntax,(<font color="#0000ff">更正,谢谢Ninputer</font>)

IEnumerable\<string> expr =<font color="#0000ff"> from s in names 
                                           where s.Length == 5
                                           orderby s
                                           select s.ToUpper();
</font>
Dim expr As IEnumerable(Of String) = Select s.ToUpper() _
                                                            From s in names _
                                                            Where s.Length = 5 _
                                                            Order By s

感觉VB更自然些,也许VB将会成为“programming language of choice”?.


Comments