匿名类型在C#中的表现 [英] Performance of anonymous types in C#

查看:204
本文介绍了匿名类型在C#中的表现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是不是不好用匿名类型的 C#

Is it bad to use anonymous types in C#?

推荐答案

是匿名类型本身不好?否。如果他们是C#团队当然不会浪费他们的时间将其添加到语言。引擎盖下,他们只是编译到标准的CLR类型。

Are anonymous types in themselves bad? No. If they were the C# team certainly wouldn't have wasted their time adding it to the language. Under the hood they just compile down to standard CLR types.

可以匿名类型,像几乎所有其他的语言特性,被滥用的是非高性能的地步。当然。

Can anonymous types, like practically every other language feature, be abused to the point of being non-performant. Sure.

这篇关于匿名类型在C#中的表现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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