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

推荐订阅源

博客园 - 叶小钗
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿
量子位
N
Netflix TechBlog - Medium
博客园 - 聂微东
博客园 - Franky
aimingoo的专栏
aimingoo的专栏
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC

博客园 - 赶路人之刚出发

集成WebSecurity的Authorize进行身份验证时,数据库连接报错问题 Html.ActionLink传递参数 Automapper结合EF实现insert,update方法 MVC中使用RemoteAttribute异步远程验证 Html.RenderPartial WebMatrix.WebSecurity创建自定义用户属性 强类型view中List<Model〉问题 ViewBag任意属性的实现方法 params关键字 配置LINQ中的datacontext的log路径,以记录datacontext执行了的查询sql SortedList LINQ join/left join/cross join/group by/group join/sortedlist/cast Linq to objects示例 yield return 和 Func IDisposable 匿名类型与扩展方法 对象初始化器和集合初始化器 C#自动属性 .net random伪随机数
Lamda表达式
赶路人之刚出发 · 2013-04-24 · via 博客园 - 赶路人之刚出发

Lamda表达式:

delegate int MyAdd(int i);
        delegate int Dosome();
        static void Main(string[] args)
        {
            MyAdd myAdd;
            //隐试声明一个参数,表达式方法体
            myAdd= x => x + 1;
            //显示声明一个参数,表达式方法体
            myAdd = (int x) => x + 1;
            //显示声明一个参数,多语句方法体
            myAdd = (int x) => { Console.Write("a"); return x + 1; };
            //隐声明一个参数,多语句方法体,增加对myAdd委托的订阅
            myAdd += x => { Console.Write("b"); return x + 2; };
            int y=myAdd(4);

            //无参数,表达式方法体;
            Dosome dosome = () => { return 1; };
            int iDosome = dosome();