Here is my model which is a WCF Proxy class
public class MyModel
{
public Employees[] MyEmpls{get;set;}
public int Id{get;set;}
public OrgName{get;set;}
}
Passing a below json structure object with MyEmpls as empty array
to MVC controller.
["Id":12, "MyEmpls":[], "OrgName":"Kekran Mcran"]
Controller
[HttpPost]
public ActionResult SaveOrg(MyModel model)
{
//model.MyEmpls is null here
}
I am expecting mode.MyEmpls
as empty c# array and not null. Could some one help me here? Do we need to write a custom model binder for this?
you can define a setter that checks if the value is null