I fear that I already know the answer to this, but wanted to see if someone out there smarter than me knows of a way to accomplish this. :)
Because of some requirements on our database, which I have no power to change, every table in our database has three mandatory columns: ID (a Guid), DateCreated, and DateModified. This includes all the cross tables that make up the many-to-many relationships.
For the sake of an explanation, assume that I have a many-to-many relationship between a Person table and a Club table, with a cross table named Person_Club. I fully expect that this forces me to create a persistable class for the Person_Club table. Is it possible to also provide a way to skip the inner table and do something like:
Code:
Person somePerson;
Club someClub;
// set these up appropriately
somePerson.Clubs.Add(someClub);
and somehow intercept and appropriately set the mandatory values on the cross table before persisting to the database? I'm assuming this isn't possible, but would be absolutely thrilled if anyone knows a way to do this, as it would really help to further abstract our object model from our database model. Thanks in advance for any help on this!