RelationalPropertyBuilderExtensions.HasComment 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
HasComment(PropertyBuilder, String) |
設定要套用至資料行的批註 |
HasComment(IConventionPropertyBuilder, String, Boolean) |
設定要套用至資料行的批註 |
HasComment<TProperty>(PropertyBuilder<TProperty>, String) |
設定要套用至資料行的批註 |
HasComment(PropertyBuilder, String)
設定要套用至資料行的批註
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
參數
- propertyBuilder
- PropertyBuilder
要設定之屬性的產生器。
- comment
- String
資料行的批註。
傳回
相同的產生器實例,以便鏈結多個呼叫。
備註
如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。
適用於
HasComment(IConventionPropertyBuilder, String, Boolean)
設定要套用至資料行的批註
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
參數
- propertyBuilder
- IConventionPropertyBuilder
要設定之屬性的產生器。
- comment
- String
資料行的批註。
- fromDataAnnotation
- Boolean
指出是否已使用資料批註指定組態。
傳回
如果已套用組態,則為相同的產生器實例, null
否則為 。
備註
如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。
適用於
HasComment<TProperty>(PropertyBuilder<TProperty>, String)
設定要套用至資料行的批註
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)
類型參數
- TProperty
正在設定之屬性的型別。
參數
- propertyBuilder
- PropertyBuilder<TProperty>
要設定之屬性的產生器。
- comment
- String
資料行的批註。
傳回
相同的產生器實例,以便鏈結多個呼叫。
備註
如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。