标签:
public string Name { get; private set; }
可以给get和set设置限制访问符。不能给任何一个写具体方法,否则不执行
调用方法异变,可直接实例委托并传递参数
delegate void Dosome(int a); Class cl = new Class(); cl.Method(new Dosome(123));
匿名委托
cl.Method(delete(int a){ Console.Write("123"); });
Lamda表达式
cl.Method(p=>Console.Write("123"),123);
List<string> list = new List<string>{"",""};
list.ForEach(a=>Console.Write("123"))
using(var sw = new Stream()){}
for(var i=0;i<10;i++){}
//左边变量如果为null则为右边的值 var b = a??"";
var abc = new ABC{ ID=1, Name="fdsa" }
static bool TO(this string val){}
var a = new{ ID=1, Name="fdsa" } var anonArray = new[] { new { name = "apple", diam = 4 }, new { name = "grape", diam = 1 }};
标签:
原文地址:http://www.cnblogs.com/chenxygx/p/4950504.html