Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.Xrm.Sdk.EntityReference.Equals(obj) behaviour

What fields does this method use to compare the objects? I need a simple method to determine if two different instances of EntityReference are referencing to the same entity. And I don't want to reinvent a bicycle if Equals() method fits my needs.

The MSDN says only that Equals returns:

true if the specified EntityReference is equal to the EntityReference object; otherwise, false.

like image 654
vladimir khozeyev Avatar asked Mar 07 '23 01:03

vladimir khozeyev


1 Answers

Partial experiments showed that Equals method compares 'Id' and 'LogicalName' fields and ignores 'Name'. But we didn't test all possible cases (there are some more fields in EntityReference).

like image 145
vladimir khozeyev Avatar answered Mar 20 '23 08:03

vladimir khozeyev