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

Data annotation for configuring comments #20569

Closed
zlzforever opened this issue Apr 8, 2020 · 1 comment · Fixed by #20676
Closed

Data annotation for configuring comments #20569

zlzforever opened this issue Apr 8, 2020 · 1 comment · Fixed by #20676
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported good first issue This issue should be relatively straightforward to fix. type-enhancement
Milestone

Comments

@zlzforever
Copy link

zlzforever commented Apr 8, 2020

We can config comment of Column/Table in the Configure method:

public override void Configure(EntityTypeBuilder<Agreement> builder)
{
    base.Configure(builder);
    builder.HasIndex("UserId", "Version").IsUnique();
    builder.HasComment("用户协议");
    builder.Property(x => x.Version).HasComment("协议版本");
}

Is there an Attribute to config the comment like bellow?

[Description("用户协议")]
public class Agreement
{
    [Description("版本号")]
    public string Version { get; private set; }
}
@zlzforever zlzforever changed the title Can you use Attribute to define column comment? Can we use Attribute to define column comment? Apr 8, 2020
@Seanxwy
Copy link

Seanxwy commented Apr 10, 2020

yes! when will it be available?

@ajcvickers ajcvickers added the good first issue This issue should be relatively straightforward to fix. label Apr 13, 2020
@ajcvickers ajcvickers added this to the Backlog milestone Apr 13, 2020
ralmsdeveloper added a commit to ralmsdeveloper/EntityFrameworkCore that referenced this issue Apr 18, 2020
ralmsdeveloper added a commit to ralmsdeveloper/EntityFrameworkCore that referenced this issue Apr 22, 2020
@lajones lajones added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 22, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview5, 5.0.0 Nov 7, 2020
@roji roji changed the title Can we use Attribute to define column comment? Data annotation for configuring comments Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported good first issue This issue should be relatively straightforward to fix. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants