ScaffoldingModelExtensions.GetDataAnnotations Method

Definition

Overloads

GetDataAnnotations(IEntityType, IAnnotationCodeGenerator)

Gets the data annotations to configure an entity type.

GetDataAnnotations(INavigation, IAnnotationCodeGenerator)

Gets the data annotations to configure a navigation property.

GetDataAnnotations(IProperty, IAnnotationCodeGenerator)

Gets the data annotations to configure a property.

GetDataAnnotations(ISkipNavigation, IAnnotationCodeGenerator)

Gets the data annotations to configure a skip navigation property.

GetDataAnnotations(IEntityType, IAnnotationCodeGenerator)

Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs

Gets the data annotations to configure an entity type.

C#
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.EntityFrameworkCore.ScaffoldingModelExtensions+<GetDataAnnotations>d__5))]
public static System.Collections.Generic.IEnumerable<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment> GetDataAnnotations (this Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType, Microsoft.EntityFrameworkCore.Design.IAnnotationCodeGenerator annotationCodeGenerator);

Parameters

entityType
IEntityType

The entity type.

annotationCodeGenerator
IAnnotationCodeGenerator

The provider's annotation code generator.

Returns

The data annotations.

Attributes

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 7.0, 8.0, 9.0

GetDataAnnotations(INavigation, IAnnotationCodeGenerator)

Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs

Gets the data annotations to configure a navigation property.

C#
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.EntityFrameworkCore.ScaffoldingModelExtensions+<GetDataAnnotations>d__7))]
public static System.Collections.Generic.IEnumerable<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment> GetDataAnnotations (this Microsoft.EntityFrameworkCore.Metadata.INavigation navigation, Microsoft.EntityFrameworkCore.Design.IAnnotationCodeGenerator annotationCodeGenerator);

Parameters

navigation
INavigation

The navigation property.

annotationCodeGenerator
IAnnotationCodeGenerator

The provider's annotation code generator.

Returns

The data annotations.

Attributes

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 7.0, 8.0, 9.0

GetDataAnnotations(IProperty, IAnnotationCodeGenerator)

Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs

Gets the data annotations to configure a property.

C#
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.EntityFrameworkCore.ScaffoldingModelExtensions+<GetDataAnnotations>d__6))]
public static System.Collections.Generic.IEnumerable<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment> GetDataAnnotations (this Microsoft.EntityFrameworkCore.Metadata.IProperty property, Microsoft.EntityFrameworkCore.Design.IAnnotationCodeGenerator annotationCodeGenerator);

Parameters

property
IProperty

The property.

annotationCodeGenerator
IAnnotationCodeGenerator

The provider's annotation code generator.

Returns

The data annotations.

Attributes

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 7.0, 8.0, 9.0

GetDataAnnotations(ISkipNavigation, IAnnotationCodeGenerator)

Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs
Source:
ScaffoldingModelExtensions.cs

Gets the data annotations to configure a skip navigation property.

C#
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.EntityFrameworkCore.ScaffoldingModelExtensions+<GetDataAnnotations>d__8))]
public static System.Collections.Generic.IEnumerable<Microsoft.EntityFrameworkCore.Design.AttributeCodeFragment> GetDataAnnotations (this Microsoft.EntityFrameworkCore.Metadata.ISkipNavigation skipNavigation, Microsoft.EntityFrameworkCore.Design.IAnnotationCodeGenerator annotationCodeGenerator);

Parameters

skipNavigation
ISkipNavigation

The skip navigation property.

annotationCodeGenerator
IAnnotationCodeGenerator

The provider's annotation code generator.

Returns

The data annotations.

Attributes

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 7.0, 8.0, 9.0