RecordDeclaration
CSharp record declaration.
Props to use the RecordDeclaration component
import { RecordDeclaration } from "@alloy-js/csharp";
<RecordDeclaration doc={core.Children} file internal name="string" partial private protected public refkey={core.Refkey} typeParameters={Record<string, core.Refkey>} />
import { RecordDeclaration } from "@alloy-js/csharp/stc";
RecordDeclaration({ doc: core.Children, file: boolean, internal: boolean, name: string, partial: boolean, private: boolean, protected: boolean, public: boolean, refkey: core.Refkey, typeParameters: Record<string, core.Refkey>,}).children(children)
Props
doc | optionalChildren Doc comment |
file | optionalboolean |
internal | optionalboolean |
name | string |
partial | optionalboolean |
private | optionalboolean |
protected | optionalboolean |
public | optionalboolean |
refkey | optionalRefkey |
typeParameters | optionalRecord<string, Refkey> |
Example
<RecordDeclaration public name="IMyRecord"> <RecordMember public name="MyProperty" type="int" /> <RecordMethod public name="MyMethod" returnType="void"> <Parameter name="value" type="int" /> </RecordMethod></RecordDeclaration>
This will produce:
public record MyIface{ public int MyProperty { get; set; } public void MyMethod(int value);}