Skip to content
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

Attribute to add comments on the table and columns #20676

Merged
merged 4 commits into from
Apr 22, 2020

Conversation

ralmsdeveloper
Copy link
Contributor

@ralmsdeveloper
Copy link
Contributor Author

Could anyone on the team tell me if this would be a good way to go?

/cc: @ajcvickers

@ralmsdeveloper ralmsdeveloper changed the title [WIP] Attribute to add comments on the table and columns Attribute to add comments on the table and columns Apr 19, 2020
Copy link
Contributor

@lajones lajones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this is the right approach. But we don't think you should use the existing DataAnnotations DescriptionAttribute: that would cause anyone who is currently using that to have these table / column comments show up - which is probably not what they intended. Instead could you create a new EntityFrameworkCore attribute similar to KeylessAttribute please?

You'd probably want this attribute to apply to Class, Property and Field (and could you add some tests for this latter as well please?).

But generally looking good. Thanks!

@ralmsdeveloper
Copy link
Contributor Author

Thanks @lajones for your comments, but we have a small detail, the idea of ​​following the KeylessAttribute, I feel comfortable, is that maybe when designing an architecture people may not want to dependence on EFCore in their domain.

But I will continue with your suggestion.

@ralmsdeveloper
Copy link
Contributor Author

@lajones

We should use:
CommentAttribute or DescriptionAttribute

What are your thoughts on that?

@lajones
Copy link
Contributor

lajones commented Apr 21, 2020

@ralmsdeveloper Personally I prefer CommentAttribute as it is more specific to what you're actually trying to achieve.

@ralmsdeveloper
Copy link
Contributor Author

@lajones I hope this time I got it right :)

Copy link
Contributor

@lajones lajones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor changes and it'll all be good.

@lajones lajones merged commit 2a2e5bc into dotnet:master Apr 22, 2020
@lajones
Copy link
Contributor

lajones commented Apr 22, 2020

Merged. Thanks for your contribution, @ralmsdeveloper

@ralmsdeveloper ralmsdeveloper deleted the feature/description-attribute branch April 22, 2020 19:09
@Seanxwy
Copy link

Seanxwy commented Jun 18, 2020

Is it ready to use?

@lajones
Copy link
Contributor

lajones commented Jun 18, 2020

@yuanxiongwei Yes. It's available in the latest preview, 5.

@ralmsdeveloper
Copy link
Contributor Author

@ajcvickers all right?
Should this be documented anywhere?

@roji
Copy link
Member

roji commented Nov 21, 2020

@ralmsdeveloper opened dotnet/EntityFramework.Docs#2892

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.

Data annotation for configuring comments
4 participants