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

推荐订阅源

G
GRAHAM CLULEY
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Privacy International News Feed
W
WeLiveSecurity
C
Cybersecurity and Infrastructure Security Agency CISA
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Proofpoint News Feed
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
Project Zero
Project Zero
H
Help Net Security
B
Blog RSS Feed
T
Threatpost
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
博客园 - 【当耐特】
月光博客
月光博客
Google Online Security Blog
Google Online Security Blog
NISL@THU
NISL@THU
The GitHub Blog
The GitHub Blog
P
Privacy & Cybersecurity Law Blog
N
News | PayPal Newsroom
T
Tenable Blog
Simon Willison's Weblog
Simon Willison's Weblog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
小众软件
小众软件
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Jina AI
Jina AI
J
Java Code Geeks
Recent Announcements
Recent Announcements
TaoSecurity Blog
TaoSecurity Blog
MongoDB | Blog
MongoDB | Blog
T
Troy Hunt's Blog
V
Visual Studio Blog
博客园_首页
L
LangChain Blog
SecWiki News
SecWiki News
O
OpenAI News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
A
Arctic Wolf
U
Unit 42

博客园 - 俩醒叁醉

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;