惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - Adrian H.

Hello in 2025 Hello World 为Silverlight控件添加鼠标滚轮支持 - Adrian H. - 博客园 LINQ表达式中关于显式范围变量的Bug jQuery太好使了 一次性下载.NET源码和pdb,并在VS2005中进行调试 Windows Server 2008: Server Core初体验 - Adrian H. C# Future Focus: 动态查找(Dynamic Lookup) Volta : Democratizing the Cloud, 1st CTP Released! Parallel Extensions for .NET 3.5 CTP! Silverlight 2.0, .NET类库源码, ASP.NET MVC... VS 2008与老版本插件的兼容性问题导致Crash Silverlight Tools for VS 2008 RTM Visual Studio 2008 RTM! 在 .NET Framework x (x < 3.5) 环境下运行带有扩展方法(Extension Method)的程序 使用ActionScript 3中的反射,实现单元测试TestRunner ASP.NET MVC Framework Announced .NET Framework 源代码将于今年发布 N-Tiers?
[C# 3.0] 传递匿名类型对象的问题
Adrian H. · 2007-11-22 · via 博客园 - Adrian H.

匿名对象一般只在同一个Scope中定义和使用, 这样才能让VS有Intellisence:

如果是通过函数传递过来的匿名类型对象, 就只能用object来传了..当然也就没了Intellisense:

但... 从Meta-Me上面看到一个Trick..虽然不太雅观...但在关键时刻可以帮你把类型信息拯救回来:

原理很简单:
同一结构的匿名类型在同一程序集中编译器只会产生一个, 但匿名类型用户是不能显式指定的, 幸好C#提供了类型推导功能..于是编译器给我们填好了类型的空缺.

Cheers!