I am looking for the best approach to use objects IDs (not some externalId).
It should:
- Be the value stored in DB as PK.
- Easily accessible from ECO Objects.
- Easily obtainable by object type and ID.
I'm thinking about adding extension method over ILoopBack: int GetId(). The
method knows everything to obtain the ID.
Also extend EcoSpace (or whatever interface) with GetById<TYPE>(int id).
This is good enough but following there are couple of disadvantages:
- NA in OCL
- GetID is always calculated. Not sure how fast it is.
- GetByID - the same.
Maybe it's just better to add ID property to class itself and map it to column
in DB?
No usage of externalId please.
Comments?
Cheers,
Thanks.
Pete