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

推荐订阅源

GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
腾讯CDC
博客园_首页
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
有赞技术团队
有赞技术团队
博客园 - 叶小钗

博客园 - 赶路人之刚出发

集成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();