Is it possible to have a DataServiceException pass along a list of errors to consumers?
Rather than just receive the standard Message, Stacktrace information I would also like to have a list of errors when various validations fail on a model.
I tried to set the DataServiceException's inner exception to FaultException.
[DataContract]
public class MyTypeWithExtraInfo
{
[DataMember]
public List<MyErrorInfo> MyErrors { get; set; }
}
[DataContract]
public class MyErrorInfo
{
[DataMember]
string PropertyId { get; set; }
[DataMember]
public string Error { get; set; }
}
Clientside I do get the DataServiceException but the operation's message only has the FaultException Reason and Type (ToString'ed) it does not have the DataMembers that I have specified in MyTypeWithExtraInfo.