Skip to content

Parameter

Define a parameter to be used in class or interface method.

import { Parameter } from "@alloy-js/csharp";
<Parameter
attributes={AttributesProp}
default={Children}
in
name={string | Namekey}
optional
out
ref
refReadonly
refkey={Refkey}
type={Children}
/>
attributesoptionalAttributesProp

Define attributes to attach

defaultoptionalChildren

Default value for the parameter

inoptionalboolean

Parameter modifier: The argument must be initialized before calling the method. The method can’t assign a new value to the parameter. The compiler might create a temporary variable to hold a copy of the argument to in parameters.

namestring | Namekey
optionaloptionalboolean

If the parmaeter is optional(without default value)

outoptionalboolean

Parameter modifier: The calling method isn’t required to initialize the argument before calling the method. The method must assign a value to the parameter.

refoptionalboolean

Parameter modifier: The argument must be initialized before calling the method. The method can assign a new value to the parameter, but isn’t required to do so.

refReadonlyoptionalboolean

Parameter modifier: The argument must be initialized before calling the method. The method can’t assign a new value to the parameter.

refkeyoptionalRefkey
typeChildren