I'm trying to add company with multiple employees with their picture. But I'm facing an issue while posting request, not worrying about internal logic.
There are 2 tables Company & Employee and I want to add company with multiple employees and their picture in a single post request, but I'm getting like this in Swagger:
Instead I want array of this... want this block multiple times:
Please, tell me how can I implement it to get the result I want?
Controller
[HttpPost]
public async Task<ActionResult<Unit>> CreateCompany([FromForm] CreateCompanyRequestViewModel Company)
{
//
}
EmployeeRequestViewModel
public class EmployeeRequestViewModel
{
public string EmployeeName { get; set; };
public IFormFile ProfileImage { get; set; };
}
CompanyViewModel
public class CreateCompanyRequestViewModel
{
public string CompanyName { get; set; };
public IFormFile CompanyLogo { get; set; };
public List<EmployeeRequestViewModel> Employees { get; set; };
}



