I want to pass a complex JSON object. But when I debug the Controller Action all virtual Properties are null. Working with ASP.NET, EF and CF.
JSON is send:
POST http://localhost:53214/api/trans/ HTTP/1.1
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Host: localhost:53214
Content-Length: 221
{
"trans": {
"Location": {
"locID": 2
}
}
}
The Model trans:
public class trans
{
[Key]
public int tID { get; set; }
//public int? locID { get; set; }
public virtual Location Location { get; set; }
}
}
So when I always post the JSON via Fiddler all Virtual properties are null.

Before I worked with Foreign Keys as commented in the Model. That works fine.
I want to rebuild the code to optimize the code itself.
How can I initialize the Properties and deserialize the JSON correct?
Regards Marcus
