Ejemplo n.º 1
0
        public async Task <IActionResult> SearchObjects([FromQuery] string qs, [FromRoute] DatabaseRouteParameters routeParameters, [FromQuery] FindQueryParameters queryParameters)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var findExpression = Foundation.Sdk.Converters.SearchStringConverter.BuildFindExpressionFromQuery(qs);
            var findResults    = await _service.FindAsync(routeParameters.DatabaseName, routeParameters.CollectionName, findExpression, queryParameters.Start, queryParameters.Limit, queryParameters.SortFieldName, System.ComponentModel.ListSortDirection.Ascending);

            return(Ok(findResults));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> FindObjects([FromRoute] DatabaseRouteParameters routeParameters, [FromQuery] FindQueryParameters queryParameters, [FromBody] string findExpression)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var findResults = await _service.FindAsync(routeParameters.DatabaseName, routeParameters.CollectionName, findExpression, queryParameters.Start, queryParameters.Limit, queryParameters.SortFieldName, System.ComponentModel.ListSortDirection.Ascending);

            return(Ok(findResults));
        }