WebApi
WebApi copied to clipboard
$skiptoken is always returns null when combined with $Select
*We are using Microsoft.AspNetCore.OData 7.5.6. We have a API which returns a list of items with pagesize as 20, and skiptoken enabled. The API returns response with nextlink with proper skiptoken when no $Select parameter is there. whenever $Select parameter is added, it always return null for skiptoken *
Assemblies affected
*Microsoft.AspNetCore.OData 7.5.6
Reproduce steps
Expose a API endpoint in ASP.Net Core with OData Support. Set page size, enable skiptoken as well. When directly accessing the API endpoint without any oData Query then the next page link coming properly with correct skiptoken=id-1 But when we use $Select odata query , then the $skiptoken=id-null is returned.
Expected result
when we use $Select odata query , then the $skiptoken should come proper
Actual result
when we use $Select odata query , then the $skiptoken=id-null is returned.
Hi , is there any workaround for this issue
Any updates on this issue, please
@xuzhg @ElizabethOkerio can you please provide any update on this issue
@xuzhg, I think the main issue is with respect to the way the sql queries are formed when $Select is Used using EF Core 3.0 When $Select used Executed DbCommand (195ms) [Parameters=[@__TypedProperty_1='?' (DbType = Int32), @__TypedProperty_0='?' (Size = 4000)], CommandType='Text', CommandTimeout='200'] SELECT TOP(@__TypedProperty_1) @__TypedProperty_0 AS [ModelID], N'name' AS [Name], [l].[Name] AS [Value], N'Id' AS [Name], [l].[Id] AS [Value] FROM Details] AS [l] WHERE [l].[Active] = CAST(1 AS bit) ORDER BY [l].[Id]
Without $Select Executed DbCommand (116ms) [Parameters=[@__TypedProperty_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='200'] SELECT TOP(@__TypedProperty_0) [l].[Id], [l].[Active], [l].[Name], [l].[SortOrder] FROM [Details] AS [l] WHERE [l].[Active] = CAST(1 AS bit) ORDER BY [l].[Id]
Any help is highly appreciated :)
Without EF Core , when raw data is loaded and verified in IEnumerable, then the issue is not there
@xuzhg @ElizabethOkerio can you please provide any update on this issue?