共用方式為


IAnnotationCodeGenerator.GenerateDataAnnotationAttributes 方法

定義

多載

GenerateDataAnnotationAttributes(IAnnotatable, IDictionary<String,IAnnotation>)

對於具有對應資料批註屬性的指定批註,會傳回這些屬性程式碼片段,並移除批註。

GenerateDataAnnotationAttributes(IEntityType, IDictionary<String,IAnnotation>)

對於具有對應資料批註屬性的指定批註,會傳回這些屬性程式碼片段,並移除批註。

GenerateDataAnnotationAttributes(IProperty, IDictionary<String,IAnnotation>)

對於具有對應資料批註屬性的指定批註,會傳回這些屬性程式碼片段,並移除批註。

GenerateDataAnnotationAttributes(IAnnotatable, IDictionary<String,IAnnotation>)

對於具有對應資料批註屬性的指定批註,會傳回這些屬性程式碼片段,並移除批註。

public virtual System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment> GenerateDataAnnotationAttributes (Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, System.Collections.Generic.IDictionary<string,Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> annotations);
abstract member GenerateDataAnnotationAttributes : Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable * System.Collections.Generic.IDictionary<string, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment>
override this.GenerateDataAnnotationAttributes : Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable * System.Collections.Generic.IDictionary<string, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment>
Public Overridable Function GenerateDataAnnotationAttributes (annotatable As IAnnotatable, annotations As IDictionary(Of String, IAnnotation)) As IReadOnlyList(Of AttributeCodeFragment)

參數

annotatable
IAnnotatable

套用批註的不指定值。

annotations
IDictionary<String,IAnnotation>

要從中產生 Fluent API 呼叫的批註集。

傳回

適用於

GenerateDataAnnotationAttributes(IEntityType, IDictionary<String,IAnnotation>)

對於具有對應資料批註屬性的指定批註,會傳回這些屬性程式碼片段,並移除批註。

public virtual System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment> GenerateDataAnnotationAttributes (Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType, System.Collections.Generic.IDictionary<string,Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> annotations);
abstract member GenerateDataAnnotationAttributes : Microsoft.EntityFrameworkCore.Metadata.IEntityType * System.Collections.Generic.IDictionary<string, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment>
override this.GenerateDataAnnotationAttributes : Microsoft.EntityFrameworkCore.Metadata.IEntityType * System.Collections.Generic.IDictionary<string, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment>
Public Overridable Function GenerateDataAnnotationAttributes (entityType As IEntityType, annotations As IDictionary(Of String, IAnnotation)) As IReadOnlyList(Of AttributeCodeFragment)

參數

entityType
IEntityType

套用批註的實體類型。

annotations
IDictionary<String,IAnnotation>

要從中產生 Fluent API 呼叫的批註集。

傳回

適用於

GenerateDataAnnotationAttributes(IProperty, IDictionary<String,IAnnotation>)

對於具有對應資料批註屬性的指定批註,會傳回這些屬性程式碼片段,並移除批註。

public virtual System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment> GenerateDataAnnotationAttributes (Microsoft.EntityFrameworkCore.Metadata.IProperty property, System.Collections.Generic.IDictionary<string,Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> annotations);
abstract member GenerateDataAnnotationAttributes : Microsoft.EntityFrameworkCore.Metadata.IProperty * System.Collections.Generic.IDictionary<string, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment>
override this.GenerateDataAnnotationAttributes : Microsoft.EntityFrameworkCore.Metadata.IProperty * System.Collections.Generic.IDictionary<string, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotation> -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment>
Public Overridable Function GenerateDataAnnotationAttributes (property As IProperty, annotations As IDictionary(Of String, IAnnotation)) As IReadOnlyList(Of AttributeCodeFragment)

參數

property
IProperty

套用批註的屬性。

annotations
IDictionary<String,IAnnotation>

要從中產生 Fluent API 呼叫的批註集。

傳回

適用於