C#C
C#3y ago
5 replies
Dharmang

Web API - Get Payload in body as well as the uploaded File using Ardalis Endpoints

How can I fetch the uploaded file as FormFile and also accept the body payload using FromBody.

Example Request.cs attached.

Also what should be the root annotation in the HandleAsync() function?
public override async Task<ActionResult<int>> HandleAsync([FromForm] DocumentTemplateDto documentTemplateDto, CancellationToken cancellationToken = default)
image.png
Was this page helpful?