RelationalPropertyBuilderExtensions.HasComment Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
HasComment(PropertyBuilder, String) |
Configures a comment to be applied to the column |
HasComment(IConventionPropertyBuilder, String, Boolean) |
Configures a comment to be applied to the column |
HasComment<TProperty>(PropertyBuilder<TProperty>, String) |
Configures a comment to be applied to the column |
Configures a comment to be applied to the column
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string comment);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string? comment);
static member HasComment : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
<Extension()>
Public Function HasComment (propertyBuilder As PropertyBuilder, comment As String) As PropertyBuilder
Parameters
- propertyBuilder
- PropertyBuilder
The builder for the property being configured.
- comment
- String
The comment for the column.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Modeling entity types and relationships for more information and examples.
Applies to
Entity Framework Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Configures a comment to be applied to the column
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string comment, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? comment, bool fromDataAnnotation = false);
static member HasComment : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function HasComment (propertyBuilder As IConventionPropertyBuilder, comment As String, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder
Parameters
- propertyBuilder
- IConventionPropertyBuilder
The builder for the property being configured.
- comment
- String
The comment for the column.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the configuration was applied,
null
otherwise.
Remarks
See Modeling entity types and relationships for more information and examples.
Applies to
Entity Framework Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Configures a comment to be applied to the column
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasComment<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string comment);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasComment<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string? comment);
static member HasComment : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
<Extension()>
Public Function HasComment(Of TProperty) (propertyBuilder As PropertyBuilder(Of TProperty), comment As String) As PropertyBuilder(Of TProperty)
Type Parameters
- TProperty
The type of the property being configured.
Parameters
- propertyBuilder
- PropertyBuilder<TProperty>
The builder for the property being configured.
- comment
- String
The comment for the column.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Modeling entity types and relationships for more information and examples.
Applies to
Entity Framework Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: