I'm trying out EFE for a large data syncing operation, and since it will involve either mass amounts of inserts or mass amounts of updates I've gone with the BulkMerge method.
Our old way involved shoving everything into a giant complex data graph and then calling SaveChanges on our context. We handled "Last Modified"-type properties by overriding our context's SaveChanges method similar to the top-voted (not accepted) answer in this other question:
Entity Framework/SQL2008 - How to Automatically Update LastModified fields for Entities?
EFE's bulk operations do not use SaveChanges, however, so now those properties are staying null. Is there a way to keep filling out those properties when saving via EFE without having to resort to database triggers? Maybe something similar to the BulkOperationExecuting event that would let you check what type of entity is being operated on and run some code accordingly?
Since you use BulkMerge, why not simply creating an extension method that will set audit field first?
context.SetAuditField(list)
context.BulkMerge(list)
You can also set some global event. That's perhaps more what you are looking for
EntityFrameworkManager.PreBulkMerge = (context, entities) =>
{
// ...code...
};