Positional vs. Named Parameters : Attribute Definition : Attribute C# Examples


C# Examples » Attribute » Attribute Definition »

 

Positional vs. Named Parameters






A positional parameter is linked by its position.
Positional parameters must be specified in the order in which they appear.
Named parameters are specified by assigning values to their names.
For an attribute, you can also create named parameters
named parameters can be assigned initial values by using their names.
A named parameter is supported by either a public field or property, which must not be read-only.

Here is the general form of an attribute specification that includes named parameters:




    
[attrib(positional-param-list,  named-param1  =  value,  named-param2  =  value,  ...)]
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Attribute
» Attribute Definition