I've already looked at how to remove $id during JSON serialization but the answers given do not seem to be working for me and I hope someone can figure out what I am doing wrong.
Here is my code:
return JsonConvert.SerializeObject(target, new JsonSerializerSettings {
NullValueHandling = NullValueHandling.Include,
PreserveReferencesHandling = PreserveReferencesHandling.None,
ContractResolver = new CustomContractResolver(),
Converters = CustomConverters
});
The output from this is still coming out with $id's, BUT, only on Entity Framework objects, is this by design? If so, is there any way to prevent those $id's on Entity Framework objects?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…