Entity Framework Extensions PostConfiguration

The PostConfiguration event is raised just before a bulk method is called, such as, BulkInsert, BulkUpdate, BulkDelete, BulkMerge, BulkSynchronize etc.

The following sets the Log property in the PostConfiguration event.

using (var context = new EntityContext())
{
    context.BulkInsert(list, options =>
    {
        options.PostConfiguration = operations =>
        {
            operations.Log = Console.WriteLine;       
        };
    });
}

Try it in EF6 | Try it in EF Core

In the PostConfiguration event, the Log property is set and to log the database commands and queries performed in that BulkInsert method.


Related