ashkufaraz
ashkufaraz

Reputation: 5297

.NET Core 3.1 API POST parameter is null

I send data to server with this parameter enter image description here

But get empty value in parameter of function enter image description here

If i set data type dynamic for input function then all things is ok and i can get values. enter image description here Report Class

public class ColumnHistory
{
    int ECH_COUNTER { get; set; }
    int TOTAL_WEIGHT { get; set; }
    int TOTAL_COUNT { get; set; }
    string COLUMNS_PLACE { get; set; }
   
}
public class InventoryInPlace
{
  
    int ELC_SIZE { get; set; }
    int STO_COUNT { get; set; }
    int STO_WGT { get; set; }
    int STO_COUNTER { get; set; }
    string ELC_ID { get; set; }

}
public class Report
{
    public ColumnHistory[] columnHistory { get; set; }
    public InventoryInPlace[] inventoryInPlace { get; set; } 
}

Upvotes: 0

Views: 238

Answers (1)

Rena
Rena

Reputation: 36645

If you do not declare the access modifier,the access level for class members is private by default.Be sure add access modifier for properties like below:

public class ColumnHistory
{
    public int ECH_COUNTER { get; set; }
    public int TOTAL_WEIGHT { get; set; }
    public int TOTAL_COUNT { get; set; }
    public string COLUMNS_PLACE { get; set; }

}
public class InventoryInPlace
{

    public int ELC_SIZE { get; set; }
    public int STO_COUNT { get; set; }
    public int STO_WGT { get; set; }
    public int STO_COUNTER { get; set; }
    public string ELC_ID { get; set; }

}

Upvotes: 2

Related Questions