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
"Method Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor+ShaperProcessingExpressionVisitor.PopulateCollection: type argument 'System.Collections.Generic.List1[System.Collections.Generic.List1[IssueWithAnyAll.Entities.File]]' violates the constraint of type parameter 'TRelatedEntity'."
Exact that code perfectly worked for EF 6, but now after upgrading to EF Core 7 it produce error.
Exception message:
Method Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor+ShaperProcessingExpressionVisitor.PopulateCollection: type argument 'System.Collections.Generic.List`1[System.Collections.Generic.List`1[IssueWithAnyAll.Entities.File]]' violates the constraint of type parameter 'TRelatedEntity'.
Stack trace:
GenericArguments[2], 'System.Collections.Generic.List`1[System.Collections.Generic.List`1[IssueWithAnyAll.Entities.File]]', on 'Void PopulateCollection[TCollection,TElement,TRelatedEntity](Int32, Microsoft.EntityFrameworkCore.Query.QueryContext, System.Data.Common.DbDataReader, Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryResultCoordinator, System.Func`3[Microsoft.EntityFrameworkCore.Query.QueryContext,System.Data.Common.DbDataReader,System.Object[]], System.Func`3[Microsoft.EntityFrameworkCore.Query.QueryContext,System.Data.Common.DbDataReader,System.Object[]], System.Func`3[Microsoft.EntityFrameworkCore.Query.QueryContext,System.Data.Common.DbDataReader,System.Object[]], System.Collections.Generic.IReadOnlyList`1[Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer], System.Collections.Generic.IReadOnlyList`1[Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer], System.Collections.Generic.IReadOnlyList`1[Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer], System.Func`5[Microsoft.EntityFrameworkCore.Query.QueryContext,System.Data.Common.DbDataReader,Microsoft.EntityFrameworkCore.Query.Internal.ResultContext,Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryResultCoordinator,TRelatedEntity])' violates the constraint of type 'TRelatedEntity'.
Description
IncludeOptimizedByPathIssue throw error
"Method Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor+ShaperProcessingExpressionVisitor.PopulateCollection: type argument 'System.Collections.Generic.List
1[System.Collections.Generic.List
1[IssueWithAnyAll.Entities.File]]' violates the constraint of type parameter 'TRelatedEntity'."Exact that code perfectly worked for EF 6, but now after upgrading to EF Core 7 it produce error.
In reproducing repo you can see this :
where IncludeOptimizedMultiple is extension :
Exception
Project
Reproducing repo is here : https://github.com/v-karnaukhov/z.entityframework.plus.issue. In repo you can find script for creating db structure (DB Scripts folder).
Further technical details
The text was updated successfully, but these errors were encountered: