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
After creating a custom Function on odata if one the navigation properties is expanded and a count added inside this expand, the numbers returned are completely wrong.
Assemblies affected
Version affected/Tested :
Microsoft.AspNetCore.OData @7.0.1
[EnableQuery][HttpGet]publicIQueryable<Post>Mine(/*int? group = null*/){varSubjectId=User.Claims.GetSubjectId();IQueryable<Post>result;result=(frompostSubsin_DbContext.PostGroupSubscribe
join postin_DbContext.Post on postSubs.PostGroup.Id equals post.Group.IdwherepostSubs.User.Id==SubjectIdselectpost);returnresult;}
indeed they are related, I've found both of these issues when working on the same task when used with a function the counts works in this crazy way and when used on a default function it throws a error like the other issue.
Short Description
After creating a custom Function on odata if one the navigation properties is expanded and a count added inside this expand, the numbers returned are completely wrong.
Assemblies affected
Version affected/Tested :
Microsoft.AspNetCore.OData @7.0.1
Reproduce steps
register a custom function on the model builder:
Create a function on the controller:
Models Used
Url that causes the error
Expected result
Each expanded item should show the correct number of item for this collection.
Actual result
Each expanded item shows a completely wrong number even though the query seem correct when analised using the sql server profiler.
Querys genereated
i got the querys this function generates using the profiler, they seem correct:
The text was updated successfully, but these errors were encountered: