Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for circular references in data contracts #302

Closed
apatenotre opened this issue Aug 3, 2019 · 0 comments · Fixed by #303
Closed

Add support for circular references in data contracts #302

apatenotre opened this issue Aug 3, 2019 · 0 comments · Fixed by #303

Comments

@apatenotre
Copy link
Contributor

apatenotre commented Aug 3, 2019

Hi!

First of all, thank you for your project.

It appears that circular references in datacontract objects are not well supported, and always lead to a StackOverflowException. This seems to be due to the way recursivity is handled while parsing objects in the MetaWCFBodyBuilder class.

Short example :

[DataContract]
public class CircularReferenceFirstObject
{
    [DataMember]
    public CircularReferenceSecondObject SecondObject { get; set; }
}

references

[DataContract]
public class CircularReferenceSecondObject
{
    [DataMember]
    public CircularReferenceFirstObject FirstObject { get; set; }
}

which references CircularReferenceFirstObject. StackOverflow is raised on first call.

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

Successfully merging a pull request may close this issue.

1 participant