User-1608281605 posted
Hi all;
I have a REST web service implemented using ASP.NET Web API. I need to add a call to join documents. So this call is passed up an array of documents, they are joined in the passed in order, and then a single document is returned.
The problem is the documents can be passed in three different ways.
- The actual file passed as a base64 encoded copy of the bits.
- A url to the file.
- A guid that identifies a file we have stored.
So what I need is something like:
[DataMember]
public Data | Url | Guid [] Files { get; set; }
Or to put it as XML:
<files>
<Data>01034f2d...</Data>
<Url>http://data.files.com/mystuff/HiThere.pdf</Url>
<Guid>38D2C12D-6D6D-4353-A8BD-A8B09DB177EF</Guid>
<Url>http://data.files.com/mystuff/HelloThere.pdf</Url>
<Guid>C6501830-18E6-4A76-BA13-96D5BE031D5A</Guid>
</files>
The problem is the ordering - I can't have this because it doesn't allow ordering between types:
[DataMember]
public string [] Data { get; set; }
[DataMember]
public string [] Url { get; set; }
[DataMember]
public string [] Guid { get; set; }
How can I do this?
thanks - dave