RelationalPropertyBuilderExtensions.HasComment Method

Definition

Overloads

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

HasComment(PropertyBuilder, String)

Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs

Configures a comment to be applied to the column

C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string comment);
C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string? comment);

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

HasComment(IConventionPropertyBuilder, String, Boolean)

Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs

Configures a comment to be applied to the column

C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string comment, bool fromDataAnnotation = false);
C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasComment (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? comment, bool fromDataAnnotation = false);

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

HasComment<TProperty>(PropertyBuilder<TProperty>, String)

Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs
Source:
RelationalPropertyBuilderExtensions.cs

Configures a comment to be applied to the column

C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasComment<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string comment);
C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasComment<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string? comment);

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