I am working on an API that accepts a list of Objects as a parameter. This is the Api I am working with:
[HttpPost("PharmacySupply")]
public async Task<List<PharmacyMedicineSupply>> GetPharmacySupply(List<MedicineDemand> medDemand)
{
SupplyRepo sr = new SupplyRepo();
return await sr.GetPharmacySupply(medDemand);
}
This is my model :
public class MedicineDemand
{
public string Medicine { get; set; }
public int DemandCount { get; set; }
}
I am passing this in swagger as parameter:
[
{Dolo,7},
{Cholecalciferol,9},
{Orthoherb,5},
{Gaviscon,2},
{Hilact,3}
{Cyclopam,1}
]
but the parameter is empty . It is showing a count of 0 while debugging. What am I doing wrong?