Property attributes in records #6044
-
Is it possible to place an attribute on a generated property without writing a record body? E.g. with this code Thanks. [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter)]
public class PropertyAttribute : Attribute
{ }
/// <summary>
///
/// </summary>
/// <param name="Bar"></param>
public record Entity([Property] string Value); |
Beta Was this translation helpful? Give feedback.
Answered by
RikkiGibson
Apr 20, 2022
Replies: 1 comment 2 replies
-
You should be able to say |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
tuscen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should be able to say
record Entity([property: SomeAttribute] string Value);
.