I was wanting to know if there is a good way to work in timestamps into junction tables using the Entity Framework (4.0). An example would be …
Clients
--------
ID | Uniqueidentifier
Name | varchar(64)
Products
-----------
ID | uniqueidentifier
Name | varchar(64)
Purchases
--------
Client | uniqueidentifier
Product | uniqueidentifier
This works smooth for junctioning the two together – but I’d like to add a timestamp. Whenever I do that, I’m forced to go through the middle-table in my code. I don’t think I can add the timestamp field to the junction table – but is there a different method that might be useable?
Well, your question says it all. You must either have a middle “Purchases” entity or not have the timestamp on Purchases. Actually, you can have the field on the table if you don’t map it, but if you want it on your entity model then these are the only two choices.