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
In current main branch instead this give a cast error:
Unhandled exception. System.InvalidCastException: Unable to cast object of type 'Microsoft.EntityFrameworkCore.ChangeTracking.ListOfReferenceTypesComparer`2[System.String[],System.String]' to type 'Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer`1[System.String[]]'.
at lambda_method207(Closure, Dictionary`2)
at Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer`1.Snapshot(T instance) in F:\src\ef-core9\src\EFCore\ChangeTracking\ValueComparer`.cs:line 336
at lambda_method196(Closure, InternalEntityEntry)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.OriginalValues..ctor(InternalEntityEntry entry) in F:\src\ef-core9\src\EFCore\ChangeTracking\Internal\InternalEntityEntry.OriginalValues.cs:line 16
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues() in F:\src\ef-core9\src\EFCore\ChangeTracking\Internal\InternalEntityEntry.cs:line 1208
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe(InternalEntityEntry entry) in F:\src\ef-core9\src\EFCore\ChangeTracking\Internal\InternalEntityEntrySubscriber.cs:line 31
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTrackingFromQuery(IEntityType baseEntityType, Object entity, ISnapshot& snapshot) in F:\src\ef-core9\src\EFCore\ChangeTracking\Internal\StateManager.cs:line 339
at Microsoft.EntityFrameworkCore.Query.QueryContext.StartTracking(IEntityType entityType, Object entity, ISnapshot& snapshot) in F:\src\ef-core9\src\EFCore\Query\QueryContext.cs:line 154
at lambda_method4(Closure, QueryContext, JObject)
at Microsoft.EntityFrameworkCore.Cosmos.Query.Internal.CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() in F:\src\ef-core9\src\EFCore.Cosmos\Query\Internal\CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs:line 269
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken) in F:\src\ef-core9\src\EFCore\Query\ShapedQueryCompilingExpressionVisitor.cs:line 152
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken) in F:\src\ef-core9\src\EFCore\Query\ShapedQueryCompilingExpressionVisitor.cs:line 164
at Program.<Main>$(String[] args) in F:\src\ef-core9\ConsoleApp1\Program.cs:line 4
at Program.<Main>(String[] args)
damieng
changed the title
Cosmos no longer supports Dictionary with TValue type of array
Cosmos no longer supports Dictionary with TValue type of primitive collection
Jun 27, 2024
Fixes#34105
This code will be consolidated with the relational UTF8 JSON code when #29825 is implemented. For now, just adding back what was already in Cosmos.
Fixes#34105
This code will be consolidated with the relational UTF8 JSON code when #29825 is implemented. For now, just adding back what was already in Cosmos.
Fixes#34105
This code will be consolidated with the relational UTF8 JSON code when #29825 is implemented. For now, just adding back what was already in Cosmos.
Previously, in EF 8, you could map a property to type
Dictionary<string, string[]>
and access the properties correctly like this:In current main branch instead this give a cast error:
I suspect this is a regression via #33456.
This also happens if using List etc.
EF Core version: main@1847e1e
Database provider: (e.g. Microsoft.EntityFrameworkCore.Cosmos)
Target framework: (e.g. .NET 9.0)
Operating system: Windows 11
IDE: Rider 2024.1.3
The text was updated successfully, but these errors were encountered: