I have this class
:
public class State{
public Dictionary<SecurityType, List<long>> assets { get; set; }
}
And action:
[HttpPost]
public virtual ActionResult GetHoldings(State state)
{
return Json(new HoldingsBL().GetHoldings(state));
}
public enum SecuritySerachType
{
Company = 1,
Security,
}
when i try to pass something like this:
{state:{assets :[{"Key":1,"Value":[]}]}}
i got empty dictionary in asset property.
i already read this solution , but i don`t realize how to solve my problem.
Some easy solution?
edit: I try to add ValueProviderFactory as Oleksii Aza said, but there is a problem to compare it to backingStore(there is already exist a dictionary check, probably for nested objects):
var d = value as IDictionary<string, object>;
if (d != null)
{
foreach (var entry in d)
{
AddToBackingStore(backingStore, MakePropertyKey(prefix, entry.Key), entry.Value);
}
return;
}
So i still stuck with this issue.