Closed pMonfared closed 5 years ago
There is a default ModelBinder for FilteredPagedQueryModel. Register it with below piece of code:
services.AddMvcCore(options =>
{
options.UseDefaultFilteredPagedQueryModelBinder();
})
Then, you can send GET requests like below:
{{endpoint}}/blogs?query={"page":1,"pageSize":100,"filter":{"logic":"and","filters":[{"field":"title","value":"Blog1","operator":"startswith"}]}}
You can find more info in the following post: شروع به کار با DNTFrameworkCore - قسمت 4 - پیادهسازی CRUD API موجودیتها
I Register it with below piece of code:
services.AddMvcCore(options =>
{
options.UseDefaultFilteredPagedQueryModelBinder();
})
but when use swagger Call Get request Roles got this error :
Please test by swagger!
This issue related to swagger.
i have a problem with crudController when use getPagedList: at this line i think you should add [FromQuery] to Get method, because when i user swagger Ui to work with API when i call Role [Get] . i got this error :
curl request :
my solution suggest :