说服我移动到.NET 3.5(2.0) [英] Convince me to move to .net 3.5 (from 2.0)

查看:129
本文介绍了说服我移动到.NET 3.5(2.0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我到新的桌面应用程序的开发。我觉得自己在家里用.NET 2.0和C#。我想我不需要LINQ,也不关心WPF和其他Vista的OID花哨的关键字。我也喜欢比较紧的身段2.0可再发行,更主要的原因是Vista和7包括在内。

I am into new desktop app development. I feel at home with .NET 2.0 and c#. I guess I don't need linq, nor care for WPF and other Vista-oid fancy keywords. I also like rather tight and slim 2.0 redistributable, even more for reason it's Vista and 7 included.

为什么要切换到3.5?

Why switch to 3.5?

推荐答案

一个字:

的LINQ

一旦你使用LINQ做了一个查询你的对象,你永远不会回去。 LINQ的不仅仅是数据库,你可以有什么样的集合,如果可以的话当然preSS自己的功能,您可以更改

Once you've done a single query on your objects using Linq you'll never go back. Linq isn't just databases, you can have any kind of collection, and if you can express yourself functionally, you can change

foreach (obj in myCollection)
{
   if (obj.property == match)
   {
      foundObj = obj;
      break;
   }
}

myCollection.Single(obj => obj.property == match);

编辑:或

var foundobj = 
(from obj in myCollection
where obj.property == match)
.Single()

哪一个更有意义?那么,当你想前preSS非常复杂的查询像这样的地方,而那,从选择一些符合一些其他财产。您可以在两个函数调用做到这一点。

Which one makes more sense? What about when you want to express much more complex queries like where this and that and that, from that select the ones that match some other property. You can do it in two function calls.

很抱歉的言论,但我真的很喜欢LINQ的。

Sorry about the rant but I really do like Linq.

这篇关于说服我移动到.NET 3.5(2.0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆