Link to home
Start Free TrialLog in
Avatar of craigdev
craigdev

asked on

How do you enable reference tracking in WCF?

I'm getting a strange error from a WCF service. The service returns a CampaignEmailDTO object, which has a 1 to many relationship with CampaignEmailRuleDTO. How do I fix this error?

The error is:

Object graph for type 'xx.xx.CampaignEmailRuleDTO' contains cycles and cannot be serialized if reference tracking is disabled.




The classes are:

[Serializable]
Class CampaignEmailDTO {
        public int Id {...}
        public string Name {...}
        public string FromAddress {...}
        ......etc.....
}

[Serializable]
Class CampaignEmailRuleDTO {
        public CampaignEmailDTO() {...}
        public int Id {...}
        public string Name {...}
        public List<CampaignEmailRuleDTO> CampaignEmailRules {...}
        public List<CampaignEmailSendLogDTO> CampaignEmailSendLogs {...}
        ......etc.....
}
Avatar of CuteBug
CuteBug
Flag of India image

Avatar of craigdev
craigdev

ASKER

Thanks, but I'm sort of hoping there is a simpler way.
ASKER CERTIFIED SOLUTION
Avatar of CuteBug
CuteBug
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial