You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using BulkSynchronizeAsync , I encounter an error when attempting to synchronize entities that include a computed column . The computed column is added correctly to the database and mapped in the EF Core model, but the bulk operation fails to handle it correctly.
An error occured while resolving mapping by name. See the inner exception for details
Missing Column : CodePrefix
On entity : Product
On Table : "Products"
at Z.BulkOperations.BulkOperation.()
at Z.BulkOperations.BulkOperation.Execute()
at Z.BulkOperations.BulkOperation.BulkSynchronize()
at .BulkSynchronize[T](DbContext this, IEntityType entityType, IEnumerable1 list, Action1 options, Boolean forceSpecificTypeMapping)
at .BulkSynchronize[T](DbContext this, IEnumerable1 entities, Action1 options)
at DbContextExtensions.BulkSynchronize[T](DbContext this, IEnumerable1 entities, Action1 options)
at DbContextExtensions.1.() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at .1.MoveNext()
Further technical details
EF version: [EF Core v8.0.5]
EF Extensions version: [EFE Core 8.102.2.5]
Database Server version: [SQLITE]
Database Provider version (NuGet): [Microsoft.Data.Sqlite.Core v8.0.5]
The text was updated successfully, but these errors were encountered:
My developer told me that, meanwhile, instead of ignoring this property, you should instead use the ColumnInputExpression to map all your properties and it should works:
Obviously, this is not the ideal solution, but at least you will be able to make it work while we can see how we can fix this issue with computed column for SQLite.
Description
When using BulkSynchronizeAsync , I encounter an error when attempting to synchronize entities that include a computed column . The computed column is added correctly to the database and mapped in the EF Core model, but the bulk operation fails to handle it correctly.
ModelConfiguration
modelBuilder.Entity<Product>() .Property(x => x.CodePrefix) .HasComputedColumnSql("SUBSTR([Code], 1, 11)", stored: true);
Generated Column
"CodePrefix" GENERATED ALWAYS AS (SUBSTR("Code", 1, 11)) STORED,
My Bulk Operations
IgnoreOnSynchronizeInsertExpression = ignore => ignore.CodePrefix, IgnoreOnInsertExpression = ignore => ignore.CodePrefix, IgnoreOnSynchronizeUpdateExpression = ignore => ignore.CodePrefix,
Exception
An error occured while resolving mapping by name. See the inner exception for details
Missing Column : CodePrefix
On entity : Product
On Table : "Products"
at Z.BulkOperations.BulkOperation.()
at Z.BulkOperations.BulkOperation.Execute()
at Z.BulkOperations.BulkOperation.BulkSynchronize()
at .BulkSynchronize[T](DbContext this, IEntityType entityType, IEnumerable
1 list, Action
1 options, Boolean forceSpecificTypeMapping)at .BulkSynchronize[T](DbContext this, IEnumerable
1 entities, Action
1 options)at DbContextExtensions.BulkSynchronize[T](DbContext this, IEnumerable
1 entities, Action
1 options)at DbContextExtensions.
1.() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at .
1.MoveNext()Further technical details
The text was updated successfully, but these errors were encountered: