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

推荐订阅源

L
LINUX DO - 最新话题
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
T
Tenable Blog
T
Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
Google Online Security Blog
Google Online Security Blog
SecWiki News
SecWiki News
P
Palo Alto Networks Blog
TaoSecurity Blog
TaoSecurity Blog
Webroot Blog
Webroot Blog
Spread Privacy
Spread Privacy
O
OpenAI News
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed
C
Check Point Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
人人都是产品经理
人人都是产品经理
S
Security @ Cisco Blogs
Scott Helme
Scott Helme
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
月光博客
月光博客
S
Securelist
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
T
Troy Hunt's Blog
W
WeLiveSecurity
GbyAI
GbyAI
N
News | PayPal Newsroom
Y
Y Combinator Blog
C
Cisco Blogs
H
Help Net Security
The GitHub Blog
The GitHub Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 【当耐特】
Jina AI
Jina AI
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
云风的 BLOG
云风的 BLOG
小众软件
小众软件
N
News and Events Feed by Topic

博客园 - 俩醒叁醉

ASP.NET MVC 4 WebAPI. Support Areas in HttpControllerSelector SQL2000安装问题(转) sql server 2008安装需要一直重启。但重启后又没有达到效果。 为数据库中所有的用户数据表生成分页存储过程 SQL 2005 字段备注获取 __doPostBack方法解析 如何在三个月掌握三年的经验(转载&&笔记) jQuery Ajax的使用 JQuery资源网站 Cookie跨域、虚拟目录 深入分析跨域cookie的问题 CnBlogsDotText使用实例 轻松搭建博客平台-开源ASP.NET 博客Subtext 的安装 表达式目录树(源MSDN) Web 2.0 编程思想:16条法则 Control Adapter 以下代码提供查询数据库中是否存在某个值 URL Routing MVC Controllers和Forms验证
CSharp——Lambda 表达式
俩醒叁醉 · 2009-03-15 · via 博客园 - 俩醒叁醉
1、定义:

           a、Lambda 表达式是一个匿名表达式。

           b、可以包含表达式和语句

           c、可用于创建委托或表达式目录树类型

           d、语法:Input params => Expression or Code Block. (左边是数据参数,右边是表达式或语句块。)

                          Eg:

           //多个参数            (x, y) => x == y            //No params            (int x, string s) => s.Length > x            //无参数,注:只有一个参数时才能省略掉括号:x => x*x             () => SomeMethod()             //语句块。 注:语句块中使用了大括号。             (input parameters) => {statement;}
     注:Lambda 语句同匿名方法一样无法用于创建表达式目录树。
2、简单用途

       a、委托中使用(Lambda表达式)

       delegate int del(int i);
       del myDelegate = x => x * x;
       int j = myDelegate(5); //j = 25

       b、委托未使用(Lambda表达式)

       delegate int del(int i);
       del myDelegate = delegate(int i) {i*i };  //匿名方法
       int j = myDelegate(5); //j = 25
    c、创建表达式目录树类型:
         using System.Linq.Expressions;
         // ...
         Expression<del> = x => x * x;