'Cannot get list object from Swagger
I have created a swagger to study and I have a problem.
My input in swagger page:
{
"content": "string",
"productId": 0,
"postId": 0,
"statusIdDetail": 0
}
and my object is:
public List<PostDetailVm> DetailPost { get; set; }
public class PostDetailVm
{
public string Content { get; set; }
public int ProductId { get; set; }
public int PostId { get; set; }
public int StatusIdDetail { get; set; }
}
My API:
[HttpPost("CreatePost")]
[Consumes("multipart/form-data")]
public async Task<IActionResult> CreatePost([FromForm] PostCreateViewModel objEmp)
When I executed, the DetailPost is count = 0, can anyone help this situation?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
