dotnet / dotnet/efcore

How to set comment on JSON column

Open
#33,375 2 comments 2 reactions 0 assignees View on GitHub
area-json area-migrations customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

## Ask a question

How to set comment on JSON column

### Include your code

I tried use `CommentAttribute` , but doesn't work.

```C#
public class JsonTable{
...
[Comment("xxx")]
public SampleJsonDataType Data {get;set;}
}

[Comment("xxx")]
public class SampleJsonDataType {
...
...
}

class JsonTableEntityConfiguration: IEntityTypeConfiguration
{
public void Configure(EntityTypeBuilder builder){
builder.OwnsOne(p => p.Data, ownedNavigationBuilder =>
{
ownedNavigationBuilder.ToJson();
}
}
}
```

### Include provider and version information

EF Core version: 8
Database provider: Microsoft.EntityFrameworkCore.SqlServer

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.