Custom Pattern for ReadOnly C# Properties
Answered
I'm looking to create a custom pattern to generate an error when properties with a specific attribute do not contain a setter. It would match something like this:
[PersistableInt]
public int Test { get; }
I can get this to work for public properties only. How do I specify a placeholder that would allow public/private/protected modifiers?
Please sign in to leave a comment.
Hello Ryan!
Thank you for contacting us.
Please try omitting public/private modifier in your pattern.
Hope it helps.
Thank you.
That worked. Thank you.