EntityFramework.BulkInsert icon indicating copy to clipboard operation
EntityFramework.BulkInsert copied to clipboard

How To Enable Trigger when using Bulk insert

Open MaxBayne opened this issue 1 year ago • 1 comments

using this extension method , will ignore trigger over table that using bulk insert over it

, how to enable trigger to be work with bulk insert

thanks

MaxBayne avatar Jan 14 '24 12:01 MaxBayne

Try the .BulkInsert(entities, BulkCopyOptions.FireTriggers) you may have to also combine with other flags attributes as well depending on what conditions you'll need: https://github.com/ghost1face/EntityFramework.BulkInsert/blob/master/src/EntityFramework.BulkInsert/BulkCopyOptions.cs#L6

This is a direct mirror of the settings on the SqlBulkCopyOptions class from System.Data.SqlClient: https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlbulkcopyoptions?view=dotnet-plat-ext-8.0

ghost1face avatar Jan 14 '24 18:01 ghost1face