I created a repository at https://github.com/Airlea404/EFExtensionsTest with the trial version to help explain it.
In our project we use database schemas, sqlite does not support that and ignores it if we use the connection string "Data Source=:memory:". If we use "Data Source=InMemorySample;Mode=Memory;Cache=Shared" however, BulkInsert throws an exception:
Exception thrown: 'System.Exception' in Z.EntityFramework.Extensions.EFCore.dll Unhandled exception. System.Exception: An error occured while resolving mapping by name. See the inner exception for details ---> System.Exception: Missing Column : CarId On entity : Car On Table : "test.Cars" at Z.BulkOperations.BulkOperation.(String , Boolean , Boolean , Boolean ) at Z.BulkOperations.BulkOperation.() --- End of inner exception stack trace --- at Z.BulkOperations.BulkOperation.() at Z.BulkOperations.BulkOperation.Execute() at Z.BulkOperations.BulkOperation.BulkInsert() at .BulkInsert[T](DbContext this, IEntityType entityType, IEnumerable1 list, Action1 options, SavingSelector savingSelector, Boolean forceSpecificTypeMapping, Boolean isOptimized) at .BulkInsert[T](DbContext this, IEnumerable1 entities, Action1 options, Boolean isBulkSaveChanges, Boolean isOptimized) at DbContextExtensions.BulkInsert[T](DbContext this, IEnumerable1 entities, Action1 options) at DbContextExtensions.BulkInsert[T](DbContext this, IEnumerable1 entities)
at EFExtensionsTest.CarRepository.BulkInsertCars(IEnumerable1 cars) in C:\code\EFExtensionsTest\EFExtensionsTest\CarRepository.cs:line 85 at Program.<Main>$(String[] args) in C:\code\EFExtensionsTest\EFExtensionsTest\Program.cs:line 25
It seems that with that specific connection string Z.EntityFramework.Extensions does use the schema and can't find the table (as shown by "On Table : "test.Cars"". The exception is also talking about a missing column, but I think it's actually about the table and the schema. If I remove the schema in CarsDbContext, it does work. This is not expected behaviour. Is this a bug?
I created a repository at https://github.com/Airlea404/EFExtensionsTest with the trial version to help explain it.
In our project we use database schemas, sqlite does not support that and ignores it if we use the connection string "Data Source=:memory:". If we use "Data Source=InMemorySample;Mode=Memory;Cache=Shared" however, BulkInsert throws an exception:
Exception thrown: 'System.Exception' in Z.EntityFramework.Extensions.EFCore.dll Unhandled exception. System.Exception: An error occured while resolving mapping by name. See the inner exception for details ---> System.Exception: Missing Column : CarId On entity : Car On Table : "test.Cars" at Z.BulkOperations.BulkOperation.(String , Boolean , Boolean , Boolean ) at Z.BulkOperations.BulkOperation.() --- End of inner exception stack trace --- at Z.BulkOperations.BulkOperation.() at Z.BulkOperations.BulkOperation.Execute() at Z.BulkOperations.BulkOperation.BulkInsert() at .BulkInsert[T](DbContext this, IEntityType entityType, IEnumerable1 list, Action1 options, SavingSelector savingSelector, Boolean forceSpecificTypeMapping, Boolean isOptimized) at .BulkInsert[T](DbContext this, IEnumerable1 entities, Action1 options, Boolean isBulkSaveChanges, Boolean isOptimized) at DbContextExtensions.BulkInsert[T](DbContext this, IEnumerable1 entities, Action1 options) at DbContextExtensions.BulkInsert[T](DbContext this, IEnumerable1 entities)at EFExtensionsTest.CarRepository.BulkInsertCars(IEnumerable
1 cars) in C:\code\EFExtensionsTest\EFExtensionsTest\CarRepository.cs:line 85 at Program.<Main>$(String[] args) in C:\code\EFExtensionsTest\EFExtensionsTest\Program.cs:line 25It seems that with that specific connection string Z.EntityFramework.Extensions does use the schema and can't find the table (as shown by "On Table : "test.Cars"". The exception is also talking about a missing column, but I think it's actually about the table and the schema. If I remove the schema in CarsDbContext, it does work. This is not expected behaviour. Is this a bug?