Reputation: 863
How can I override the SaveChanges() method in EF5 WITHOUT using a code-first approach? Some of my tables use a char(32) PK (basically, a stripped down GUID) that must be stuffed prior to save. Same with the audit trail. Every search I have tried always assumes that a code-first approach and NOT model-first.
Upvotes: 0
Views: 74
Reputation: 366
The generated context class is partial. Just add another code file where you extend the class and override SaveChanges
there.
Upvotes: 1