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
Hello
When I use AddBulkOperationSupport I get this error. In some tables I have DateOnly which is nullable and in some it is not
And I am not using TempTable
I am using the latest version
Please help me to solve the problem
System.InvalidOperationException: 'The table 'TempTables.TempTable1' cannot be used for entity type 'Thinktecture:TempTable:Thinktecture.EntityFrameworkCore.TempTables.TempTable<DateOnly?> (TempTable<DateOnly?>)' since it is being used for entity type 'Thinktecture:TempTable:Thinktecture.EntityFrameworkCore.TempTables.TempTable (TempTable)' and potentially other entity types, but there is no linking relationship. Add a foreign key to 'Thinktecture:TempTable:Thinktecture.EntityFrameworkCore.TempTables.TempTable<DateOnly?> (TempTable<DateOnly?>)' on the primary key properties and pointing to the primary key on another entity type mapped to 'TempTables.TempTable1'.'
Cause: The error occurs when something in your model configuration renames all entity types, for example a naming-convention plugin or a loop over modelBuilder.Model.GetEntityTypes() that calls SetTableName(...)/ToTable(...). AddBulkOperationSupport registers internal entity types such as TempTable<DateOnly> and TempTable<DateOnly?>. A rename based on the CLR type name maps both of them to the same name (TempTable`1), and EF Core then fails model validation with the "no linking relationship" error you posted. The error message in your report contains TempTable`1, which is the CLR reflection name, so I assume you have such a rename in place.
Fix: Released in 10.4.0-beta03. The internal registrations now use the data-annotation configuration source, so conventions (including naming-convention plugins) can no longer override their table names. Please update and try again.
One caveat: If you rename tables explicitly in OnModelCreating, for example:
Activity
[-]User AddBulkOperationSupport[/-][+]Use AddBulkOperationSupport[/+]fix: prevent other conventions from overriding temp table and collect…
PawelGerr commentedon Jul 18, 2026
Thanks for the report!
Cause: The error occurs when something in your model configuration renames all entity types, for example a naming-convention plugin or a loop over
modelBuilder.Model.GetEntityTypes()that callsSetTableName(...)/ToTable(...).AddBulkOperationSupportregisters internal entity types such asTempTable<DateOnly>andTempTable<DateOnly?>. A rename based on the CLR type name maps both of them to the same name (TempTable`1), and EF Core then fails model validation with the "no linking relationship" error you posted. The error message in your report containsTempTable`1, which is the CLR reflection name, so I assume you have such a rename in place.Fix: Released in 10.4.0-beta03. The internal registrations now use the data-annotation configuration source, so conventions (including naming-convention plugins) can no longer override their table names. Please update and try again.
One caveat: If you rename tables explicitly in
OnModelCreating, for example:then explicit configuration still wins by design and the error will remain. In that case, skip the internal entity types in your loop:
If the beta does not resolve the problem for you, please provide a minimal repro.