If I have 3 tables:
Customer
CustID
NameList
ListID
TitleCustomersLists
CustID
ListID
Entity Framework makes it very easy to grab lists of a customer.
db.Customers.FirstOrDefault(c => c.Name == "Bob").Lists
I need save a timestamp of the creation of the relational table so I can see when the customer was added to a list.
I don’t want to add a column ‘timestamp’ to the relational table because it will mess with the intuitive LINQ functionality, as the table CustomersLists appears instead of Customer.Lists.
I have about 12 tables that need to have this timestamp, most of which don’t have many to many relationships. Just fishing to see if anyone has a really good solution I’m overlooking.
Do not map the
timestampin EF mapping. And set the default value for thattimestampcolumn on database layer to:getDate(). It will set it to current “datetime” on insert.