Property
Render a C# class property.
Properties for Property component
import { Property } from "@alloy-js/csharp";
<Property abstract attributes={AttributesProp} doc={Children} extern file get init initializer={Children} internal name={Namekey | string} new nullable override private protected public readonly refkey={Refkey} required sealed set static type={Children} virtual />import { Property } from "@alloy-js/csharp/stc";
Property({ abstract: boolean, attributes: AttributesProp, doc: Children, extern: boolean, file: boolean, get: boolean, init: boolean, initializer: Children, internal: boolean, name: Namekey | string, new: boolean, nullable: boolean, override: boolean, private: boolean, protected: boolean, public: boolean, readonly: boolean, refkey: Refkey, required: boolean, sealed: boolean, set: boolean, static: boolean, type: Children, virtual: boolean,}).children(children)| abstract | optionalboolean |
| attributes | optionalAttributesPropDefine attributes to attach |
| doc | optionalChildrenDoc comment |
| extern | optionalboolean |
| file | optionalboolean |
| get | optionalbooleanIf property should have a getter |
| init | optionalbooleanIf property should only be set on the type creation |
| initializer | optionalChildrenProperty initializer |
| internal | optionalboolean |
| name | Namekey | string |
| new | optionalboolean |
| nullable | optionalbooleanProperty initializer |
| override | optionalboolean |
| private | optionalboolean |
| protected | optionalboolean |
| public | optionalboolean |
| readonly | optionalboolean |
| refkey | optionalRefkey |
| required | optionalbooleanSet required modifier on property https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/required |
| sealed | optionalboolean |
| set | optionalbooleanIf property should have a setter |
| static | optionalboolean |
| type | ChildrenProperty type |
| virtual | optionalboolean |
Example
Section titled “Example”<ClassProperty public name="My" get set />
public int My { get; set; };