-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Hi,
Using the Nuget package EntityFramework6.BulkInsert, I'm trying to insert a collection of 200-300 items into a table and failing with the following exception:
System.InvalidCastException: 'Specified cast is not valid.'
Stack Trace: at EntityFramework.MappingAPI.Mappers.MapperBase.MapProperty(EntityMap entityMap, EdmProperty edmProperty, Int32& i, String& prefix)
The C# call is as follows:
ctx.BulkInsert(ds, ctx.Database.CurrentTransaction?.UnderlyingTransaction);
where ctx is a DbContext instance. There is an underlying transaction.
The table structure DSearch is simple:
public class DSearch
{
public Guid Id { get; set; }
public string Match { get; set; }
public int Distance { get; set; }
public int Index { get; set; }
}Worth mentioning is that the PK on that table is composite, formed of all 4 properties/columns.
Metadata
Metadata
Assignees
Labels
No labels