摘要:
主要约束:主要约束可以是一个引用类型,标识了一个没有密封的类。指定一个引用类型约束时,相当于向编译器承诺:一个指定类型的实参要么是与约束类型相同的类型,要么是从约束类型派生的一个类型。如果一个类型参数没有指定主要约束,就默认认为System.Object。有两个特殊的主要约束:class和struct。其中class想编译器承诺一个指定的类型实参是引用类型 internal sealed ... 阅读全文
posted @ 2012-08-15 22:44
HelloWorld.Michael
阅读(369)
评论(0)
推荐(0)
摘要:
泛型委托:委托实际只是提供了4个方法的一个类定义。这4个方法包括:一个构造器、一个Invoke方法、一个BeginInvoke方法和一个EndInvoke方法。如果定义的一个委托类型指定了类型参数,编译器会定义委托类的方法,用指定的类型参数替换方法的参数类型和返回值类型 利用逆变或者协变,可以将泛型委托类的一个变量转型为同一个委托类型的另一个变量,后者的泛型参数类型不同 不变量(invaria... 阅读全文
posted @ 2012-08-15 22:04
HelloWorld.Michael
阅读(430)
评论(0)
推荐(0)
摘要:
HTML helper Description DisplayFor Returns HTML markup for each property in the object that’s represented by the expression ... 阅读全文
posted @ 2012-08-15 13:57
HelloWorld.Michael
阅读(211)
评论(0)
推荐(0)
摘要:
There are three different ways in which data can be passed to a view by using the ViewDataDictionary, the ViewBag, and strongly typed views. ViewDataDictionary public ViewResult Show(int id) ... 阅读全文
posted @ 2012-08-15 11:18
HelloWorld.Michael
阅读(212)
评论(0)
推荐(0)
摘要:
By Default:public ActionResult Create(){ return View();}Calling the View method returns a ViewResult object that knows how to render a particular view. When this method is called with no arguments,... 阅读全文
posted @ 2012-08-15 11:03
HelloWorld.Michael
阅读(157)
评论(0)
推荐(0)

浙公网安备 33010602011771号