Identifying an Entity

What is the best way to identify an entity by - a unique way of telling that entity X is not entity Y (even though they may both look exactly the same).

While looking at Entity I thought of using Entity.GetLocalPos as the entities that I am identifying are doors (although that did raise concerns over if the door may move as part of it’s operation.

This led me to Entity._index which has the link to use it in a metatable (and a warning to not use it directly).

Which is the best method (or is there another better one)?


How I did not see that, I do not know.