'ASP.net WebAPI using [FromUri] Attribute problems
This's my controller code:
[HttpGet]
[Route()]
public async Task<List<GetCategoryTreeOutputDto>> GetDatasetCategoryTreeAsync([FromUri(Name = "")] GetCategoryTreeInputDto input)
{
return await _category.GetDatasetCategoryTreeAsync(input);
}
public class GetCategoryTreeInputDto
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
public int? ParentId { get; set; }
}
When I assign a parameter value,it works,So I have to give a value to use it?But these parameters don't always need to be assigned value.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
