我有一个带有方法GetAll的控制器,该方法的所有参数都是可选的(具有默认值)。概念是使以下任何请求均有效:/crm/contacts/crm/contacts?sort=created_by/crm/contacts?search=My%20Customer/crm/contacts?sort=created_by&take=100/crm/contacts?from=10&take=100/crm/contacts?search=My%20Customer&sort=created_by&take=100代码:[HttpGet][Route("")]public async Task<DTO.CRM.contact[]> GetAllAsync( int? from = null, int? take = 10, string search = null, string[] sort = null){在调试中,我怀疑sort为null,相反,我将其视为{string [0]}。我在macOS上使用dotnet core 2.1.4。如果未通过url传递,我如何才能获得真正为null的排序?
- 1 回答
- 0 关注
- 201 浏览
添加回答
举报
0/150
提交
取消