Attributes on primary constructors #8043
-
It is currently impossible to add attributes to a primary constructor: [MyAttribute] // applies to entire class, not constructor
public class MyClass(int value)
{
// ...
} I propose |
Beta Was this translation helpful? Give feedback.
Answered by
CyrusNajmabadi
Apr 8, 2024
Replies: 1 comment
-
This is not the case. Roslyn, as an example, places attributes on primary constructors all over the place. You just need the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
333fred
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not the case. Roslyn, as an example, places attributes on primary constructors all over the place. You just need the
[method: ...]
syntax to specify this :)