Christo S. Christov
Christo S. Christov

Reputation: 2309

How can I add getter and setter to PropertyDeclarationSyntax?

I'm creating a tool which can create properties through Roslyn. I would like to add getter and setters to a PropertyDeclarationSyntax.

How can I do this?

Upvotes: 4

Views: 894

Answers (1)

Tamas
Tamas

Reputation: 6420

You need to add an AccessorList, with accessors. Check out this online tool for the exact syntax tree creation: Roslyn Quoter.

Upvotes: 7

Related Questions