I work with asp.net core 2.2 and jquery and have to submit a complex object ('main class') from a view to a controller with simple data fields and some array's.
As soon as I have added the array in the c# 'main class' definition (see below) and submitted the (correct filled) array over ajax (post), the whole object was null in the controller.
First, I thought, the missing "traditional: true," to my ajax call was the reason, but this is not the case.
In my case the reason was the definition in the c# 'main class'.
In the 'main class', I had:
public List<EreignisTagNeu> oEreignistageNeu { get; set; }
and EreignisTagNeu was defined as:
public class EreignisTagNeu
{
public int iHME_Key { get; set; }
}
I had to change the definition in the 'main class' to:
public List<int> oEreignistageNeu { get; set; }
Now it works.
So... for me it seems as asp.net core has a problem (with post), if the list for an array is not defined completely in the 'main class'.
Note:
In my case this works with or without "traditional: true," to the ajax call