ForeignKeyPropertyDiscoveryConvention Classe
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Uma convenção que localiza propriedades de chave estrangeira para relações com base em seus nomes, ignorando maiúsculas e minúsculas:
- [nome da propriedade de navegação] [nome da propriedade da chave principal]
- [nome da propriedade de navegação] Id
- [nome da entidade principal] [nome da propriedade da chave principal]
- [nome da entidade principal] Id
public class ForeignKeyPropertyDiscoveryConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeMemberIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPrincipalEndChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRequirednessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyNullabilityChangedConvention
public class ForeignKeyPropertyDiscoveryConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeMemberIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPrincipalEndChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRequirednessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyNullabilityChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationInverseChangedConvention
type ForeignKeyPropertyDiscoveryConvention = class
interface IForeignKeyAddedConvention
interface IConvention
interface INavigationAddedConvention
interface IPropertyAddedConvention
interface IEntityTypeMemberIgnoredConvention
interface IPropertyNullabilityChangedConvention
interface IPropertyFieldChangedConvention
interface IForeignKeyPropertiesChangedConvention
interface IForeignKeyPrincipalEndChangedConvention
interface IForeignKeyUniquenessChangedConvention
interface IForeignKeyRequirednessChangedConvention
interface IKeyAddedConvention
interface IKeyRemovedConvention
interface IEntityTypePrimaryKeyChangedConvention
interface IModelFinalizedConvention
type ForeignKeyPropertyDiscoveryConvention = class
interface IEntityTypeMemberIgnoredConvention
interface IConvention
interface IEntityTypePrimaryKeyChangedConvention
interface IForeignKeyAddedConvention
interface IForeignKeyPropertiesChangedConvention
interface IForeignKeyPrincipalEndChangedConvention
interface IForeignKeyUniquenessChangedConvention
interface IForeignKeyRequirednessChangedConvention
interface IKeyAddedConvention
interface IKeyRemovedConvention
interface INavigationAddedConvention
interface ISkipNavigationForeignKeyChangedConvention
interface ISkipNavigationInverseChangedConvention
interface IPropertyAddedConvention
interface IPropertyNullabilityChangedConvention
interface IPropertyFieldChangedConvention
interface IModelFinalizingConvention
Public Class ForeignKeyPropertyDiscoveryConvention
Implements IEntityTypeMemberIgnoredConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyPrincipalEndChangedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRequirednessChangedConvention, IForeignKeyUniquenessChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelFinalizedConvention, INavigationAddedConvention, IPropertyAddedConvention, IPropertyFieldChangedConvention, IPropertyNullabilityChangedConvention
Public Class ForeignKeyPropertyDiscoveryConvention
Implements IEntityTypeMemberIgnoredConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyPrincipalEndChangedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRequirednessChangedConvention, IForeignKeyUniquenessChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelFinalizingConvention, INavigationAddedConvention, IPropertyAddedConvention, IPropertyFieldChangedConvention, IPropertyNullabilityChangedConvention, ISkipNavigationForeignKeyChangedConvention, ISkipNavigationInverseChangedConvention
- Herança
-
ForeignKeyPropertyDiscoveryConvention
- Implementações
-
IConvention IEntityTypeMemberIgnoredConvention IEntityTypePrimaryKeyChangedConvention IForeignKeyAddedConvention IForeignKeyPrincipalEndChangedConvention IForeignKeyPropertiesChangedConvention IForeignKeyRequirednessChangedConvention IForeignKeyUniquenessChangedConvention IKeyAddedConvention IKeyRemovedConvention IModelFinalizedConvention INavigationAddedConvention IPropertyAddedConvention IPropertyFieldChangedConvention IPropertyNullabilityChangedConvention IModelFinalizingConvention ISkipNavigationForeignKeyChangedConvention ISkipNavigationInverseChangedConvention
Comentários
Se nenhuma propriedade correspondente tiver sido encontrada, a relação não representará uma propriedade, o lado dependente não será ambíguo e não será derivado, se a relação for um-para-um, as propriedades da chave primária serão usadas; caso contrário, a convenção tentará corresponder as propriedades com o nome exato como propriedades de chave principal se forem um subconjunto adequado do PK dependente.
Se uma correspondência foi encontrada, mas os tipos de propriedade não são compatíveis com os tipos de chave principal, nenhuma correspondência adicional é pesquisada.
Se a relação usar propriedades de sombra criadas por convenção, elas serão recriadas para remover sufixos usados para tornar os nomes exclusivos.
Consulte Convenções de criação de modelo para obter mais informações e exemplos.
Construtores
ForeignKeyPropertyDiscoveryConvention(ProviderConventionSetBuilderDependencies) |
Cria uma nova instância de ForeignKeyPropertyDiscoveryConvention. |
Propriedades
Dependencies |
Dependências para esse serviço. |
Métodos
Aplica-se a
Entity Framework