Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

KnockoutUtilities.ConvertData ignore JsonIgnore Attribute #29

Open
diegohoyos opened this issue May 26, 2013 · 1 comment
Open

KnockoutUtilities.ConvertData ignore JsonIgnore Attribute #29

diegohoyos opened this issue May 26, 2013 · 1 comment

Comments

@diegohoyos
Copy link
Contributor

I use JsonIgnore attribute to avoid circular references in Json serialization of entity framework classes. The problem is in KnockoutUtilities.ConvertData method because ignore this attribute when explore properties using reflection. This cause stack overflow exception when explore recursive circular references between entity framework objects.

@diegohoyos
Copy link
Contributor Author

Please add the attribute validation. This avoid recursive exploration of objects that will not serialize by json.net, and avoid stack overflow exception caused by entity framework proxys with circular references.

if (property.GetCustomAttributes(typeof(Newtonsoft.Json.JsonIgnoreAttribute), false).Length > 0)
continue;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant