I have a few entities in my project which have a composite primary key and when the tracking key for these entities is generated there will be an overlap between the keys.
I have an Order entity and an OrderLine entity, PK on OrderLIne is orderId, lineNumber. When creating a tracking key for the OrderLine entity it comes out to something like this: "OrderLine3581", given an orderId of 385 and lineNumber 1. Needless to say there are a lot of issues with this key, once a variety of entities will populate the database we'll get the wrong entity from the cache. I have made some changes to the template to use EntityLocator.ConstructKeyFromPkItems() whenever it needs to create keys, and in that method I have this:
for (int i = 0; i < pkItems.Length; i++)
{
if (pkItems
!= null)
sb.Append('|').Append(pkItems
.ToString());
}
I think this should be integrated into the release, as it is quite a gap for composite keys.
"Small is the number of them that see with their own eyes, and feel with their own hearts" Albert Einstein