Skip to content

Support DescriptionAttribute and ReadOnlyAttribute #3162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jgarciadelanoceda
Copy link
Contributor

@jgarciadelanoceda jgarciadelanoceda commented Nov 20, 2024

contributes #1954
I do not really know what is intended with DisplayName attribute, but I am sure someone can give me advice in what to do with that attribute

@martincostello
Copy link
Collaborator

I do not really know what is intended with DisplayName attribute

IIRC, it's typically used to provide non-code text for UI elements for code members. For example:

[DisplayName("First name")]
public string FirstName { get; set; }

I've seen them commonly used to for the Visual Studio designer.

For example, this code renders how property windows like the one below Visual Studio.

image

@jgarciadelanoceda
Copy link
Contributor Author

IIRC, it's typically used to provide non-code text for UI elements for code members. For example:

I do not see the need for integrating this attribute, because there is already integrated by the serializers the JsonPropertyName and for Query/Path variables you can put the name of the parameter overriding the name of the object like what we do here:

public IEnumerable<Product> Get([FromQuery(Name = "kw")]string keywords = "foobar")

Javier García de la Noceda Argüelles added 2 commits November 22, 2024 04:29
@martincostello martincostello added this to the v7.0.1 milestone Nov 22, 2024
@martincostello martincostello merged commit bb49884 into domaindrivendev:master Nov 22, 2024
9 checks passed
@jgarciadelanoceda jgarciadelanoceda deleted the issue_1954_ComponentModelAttributes branch November 22, 2024 15:05
This was referenced Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants