-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TemporalAll fails with JSON columns #30478
Labels
area-json
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Comments
We have some validation making sure that the navigations coming from the entity mapped to temporal table can be expanded. However, we should circumvent all those checks for JSON entities, since those are always mapped to the same table as the owner (so they are always in sync) - we should also allow operations other than AsOf if all navigations are JSON based. |
Temporary workaround: const string sqlServerIsTemporalAnnotation = "SqlServer:IsTemporal";
var entityType = (RuntimeEntityType)context.Model.FindRuntimeEntityType(typeof(YourJsonFieldType))!;
entityType.SetAnnotation(sqlServerIsTemporalAnnotation, true);
var data = await context.[Your query here];
entityType.RemoveAnnotation(sqlServerIsTemporalAnnotation); |
maumar
added a commit
that referenced
this issue
Oct 10, 2023
We had a validation step preventing non AsOf temporal queries when we use navigation properties, as well as checking that all entities in the navigation chain are set as temporal. This should not apply to JSON entities, since those always part of the entity. Fix is to no longer perform the check for navigations mapped to JSON. Fixes #30478
maumar
added a commit
that referenced
this issue
Oct 10, 2023
We had a validation step preventing non AsOf temporal queries when we use navigation properties, as well as checking that all entities in the navigation chain are set as temporal. This should not apply to JSON entities, since those always part of the entity. Fix is to no longer perform the check for navigations mapped to JSON. Fixes #30478
maumar
added a commit
that referenced
this issue
Oct 10, 2023
We had a validation step preventing non AsOf temporal queries when we use navigation properties, as well as checking that all entities in the navigation chain are set as temporal. This should not apply to JSON entities, since those always part of the entity. Fix is to no longer perform the check for navigations mapped to JSON. Fixes #30478
maumar
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Oct 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-json
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
If you have a JSON column in a temporal table and calls
TemporalAll()
, anSystem.InvalidOperationException
is thrown with the message:This is very similar to #29156.
Full sample
Include provider and version information
EF Core version: 7.0.4
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 7.0
Operating system: Windows 11
IDE: Visual Studio 2022 17.5
The text was updated successfully, but these errors were encountered: