EntityKey.Equals Método

Definição

Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object.

Sobrecargas

Equals(Object)

Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object.

Equals(EntityKey)

Retorna um valor que indica se essa instância é igual a um EntityKey especificado.Returns a value that indicates whether this instance is equal to a specified EntityKey.

Equals(Object)

Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

Parâmetros

obj
Object

Um Object a ser comparado com essa instância.An Object to compare with this instance.

Retornos

Boolean

true se essa instância e obj tiverem valores iguais, caso contrário, false.true if this instance and obj have equal values; otherwise, false.

Comentários

As chaves temporárias têm semânticas de comparação diferentes das chaves permanentes:Temporary keys have different comparison semantics than permanent keys:

  • As chaves temporárias usam a igualdade de referência.Temporary keys use reference equality. Ou seja, duas referências à mesma instância temporária exata EntityKey são iguais, mas nenhuma das outras EntityKey instâncias é igual.That is, two references to the exact same temporary EntityKey instance are equal but no other EntityKey instances are equal.

  • As chaves permanentes determinam a igualdade com base nos valores das propriedades de chave contidas e do EntitySet .Permanent keys determine equality based on the values of the contained key properties and the EntitySet. Ou seja, você pode ter duas EntityKey instâncias separadas que sejam iguais se seus EntitySet objetos forem iguais e seus valores de chave forem iguais.That is, you can have two separate EntityKey instances that are equal if their EntitySet objects are the same and their key values are equal.

Além disso, as chaves temporárias não têm EntitySet valores de chave ou, mas as chaves permanentes fazem.In addition, temporary keys have no EntitySet or key values, but permanent keys do.

Aplica-se a

Equals(EntityKey)

Retorna um valor que indica se essa instância é igual a um EntityKey especificado.Returns a value that indicates whether this instance is equal to a specified EntityKey.

public:
 virtual bool Equals(System::Data::EntityKey ^ other);
public bool Equals (System.Data.EntityKey other);
override this.Equals : System.Data.EntityKey -> bool
Public Function Equals (other As EntityKey) As Boolean

Parâmetros

other
EntityKey

Um objeto EntityKey a ser comparado com essa instância.An EntityKey object to compare with this instance.

Retornos

Boolean

true se essa instância e other tiverem valores iguais, caso contrário, false.true if this instance and other have equal values; otherwise, false.

Implementações

Comentários

As chaves temporárias têm semânticas de comparação diferentes das chaves permanentes:Temporary keys have different comparison semantics than permanent keys:

  • As chaves temporárias usam a igualdade de referência.Temporary keys use reference equality. Ou seja, duas referências à mesma instância temporária exata EntityKey são iguais, mas nenhuma das outras EntityKey instâncias é igual.That is, two references to the exact same temporary EntityKey instance are equal but no other EntityKey instances are equal.

  • As chaves permanentes determinam a igualdade com base nos valores das propriedades de chave contidas e do EntitySet .Permanent keys determine equality based on the values of the contained key properties and the EntitySet. Ou seja, você pode ter duas EntityKey instâncias separadas que sejam iguais se seus conjuntos de entidades forem iguais e seus valores de chave forem iguais.That is, you can have two separate EntityKey instances that are equal if their entity sets are the same and their key values are equal.

Além disso, as chaves temporárias não têm EntitySet valores de chave ou, mas as chaves permanentes fazem.In addition, temporary keys have no EntitySet or key values, but permanent keys do.

Aplica-se a