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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
F
Full Disclosure
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
Hacker News: Ask HN
Hacker News: Ask HN
V
Visual Studio Blog
IT之家
IT之家
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
月光博客
月光博客
H
Heimdal Security Blog
T
The Blog of Author Tim Ferriss
腾讯CDC
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Troy Hunt's Blog
小众软件
小众软件
Jina AI
Jina AI
博客园 - Franky
Scott Helme
Scott Helme
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
TaoSecurity Blog
TaoSecurity Blog
F
Fortinet All Blogs
Y
Y Combinator Blog
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
量子位
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Last Watchdog
The Last Watchdog
博客园 - 三生石上(FineUI控件)
L
LINUX DO - 最新话题

博客园 - 俩醒叁醉

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;