New Parameter syntax learned by VAR grid = new webgrid (model, canpage: True, rowsperpage: 2)

Source: Internet
Author: User

VaR grid = new webgrid (model, canpage: True, rowsperpage: 2) is not supported in. net2.0 and 3.x.

In MySQL 4.0, the following code is used:

 1   Using  System;
2   Using System. Collections. Generic;
3   Using System. LINQ;
4   Using System. text;
5
6   Namespace Leleapplication1
7 {
8 Class Program
9 {
10 //
11 Static String Getstring ( String A, String B)
12 {
13 Return A + B;
14
15 }
16
17 Static Void Main ( String [] ARGs)
18 {
19 // Instantiate class (constructor with parameters)
20 CS C = New CS (: " A1 " , B: " B1 " );
21 // . NET 2.0 does not support writing
22 String Str = Getstring (: " G " , B: " C " );
23 Console. writeline (STR );
24 }
25 }
26 Class CS
27 {
28 Public CS ( String A, String B)
29 {
30 }
31 }
32
33
34 }

I personally think:This method is used in multiple overload methods. When a class has multiple constructor functions, it has great advantages for parameter description and addsCodeReadability


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.