Property
Render a C# class property.
Properties for Property component
import { Property } from "@alloy-js/csharp";
<Property abstract doc={Children} extern file get init initializer={Children} internal name="string" new nullable override private protected public readonly refkey={Refkey} sealed set static type={Children} virtual />
import { Property } from "@alloy-js/csharp/stc";
Property({ abstract: boolean, doc: Children, extern: boolean, file: boolean, get: boolean, init: boolean, initializer: Children, internal: boolean, name: string, new: boolean, nullable: boolean, override: boolean, private: boolean, protected: boolean, public: boolean, readonly: boolean, refkey: Refkey, sealed: boolean, set: boolean, static: boolean, type: Children, virtual: boolean,}).children(children)
Props
abstract | optionalboolean |
doc | optionalChildren Doc comment |
extern | optionalboolean |
file | optionalboolean |
get | optionalboolean If property should have a getter |
init | optionalboolean If property should only be set on the type creation |
initializer | optionalChildren Property initializer |
internal | optionalboolean |
name | string |
new | optionalboolean |
nullable | optionalboolean Property initializer |
override | optionalboolean |
private | optionalboolean |
protected | optionalboolean |
public | optionalboolean |
readonly | optionalboolean |
refkey | optionalRefkey |
sealed | optionalboolean |
set | optionalboolean If property should have a setter |
static | optionalboolean |
type | Children Property type |
virtual | optionalboolean |
Example
<ClassProperty public name="My" get set />
public int My { get; set; };