I was able to reduce the 5 minute Insert time to around 30 seconds by using the Extended Entity Framework sample version. It worked wonderfully, but using that approach would have cost money. It worked after I only inserted a using clause and one line of code.
_context.AddRange(history); //_context.SaveChanges(); <-- Previous Code _context.BulkSavechanges(); //New Entity Framework Extensions Code
I gave EFCore a go. BulkExtensions. I could not make this work. My Fluent API Entity Map's Conversion mapping didn't appear to sit well with it.
builder.Entity<Transaction>() .Property(t => t.Receiver) .HasColumnName("receiverdata") .HasConversion(v => JsonConvert.SerializeObject(v), v => JsonConvert.DeserializeObject<ReceiverEntity>(v));
EFCore. I'm not sure what the problem is because BulkExtensions indicates that they support Conversion. It will be interesting to see whether there is a method to make this work or not when I put the issue on GitHub.