Closed andreamorello93 closed 1 year ago
i'm trying to figure out how to handle MaxTop in sql query that is handled in EnableQuery Attribute in standard configuration:
my controller:
BaseODataDTOController.cs
Generated SQL query for request: https://localhost:44393/odata/product
SELECT [p].[ProductID] AS [ProductId] FROM [Production].[Product] AS [p]
As you can se there's no top in sql statement. how can i fix this?
Hi,
Setting a PageSize before running the query will generate a TOP statement:
querySettings.ODataSettings.PageSize
public async Task<IEnumerable> Get([SwaggerHide] ODataQueryOptions options) => (await _repository.Queryable().GetQueryAsync(_mapper, options, querySettings));
Br, Leo
Thank you Leo!
i'm trying to figure out how to handle MaxTop in sql query that is handled in EnableQuery Attribute in standard configuration:
my controller:
BaseODataDTOController.cs
Generated SQL query for request: https://localhost:44393/odata/product
SELECT [p].[ProductID] AS [ProductId] FROM [Production].[Product] AS [p]
As you can se there's no top in sql statement. how can i fix this?