I’m able to return an image as byte array from my .NET web service..
My question is this, what if i want to return more than a single image in one request.
For example, my web method currently looks something like this:
public byte[] GetImage(string filename)
BUT what I’m trying to work out is how i would achieve something more like this:
public ..?... GetAllMemberStuffInOneHit(string memberID)
This would return, for example, a few images, along with some other information such as a members name and department.
Can this be done? Please help, Thank you.
Absolutely. Instead of returning just a byte array, create a DTO class that has the byte array as well as potentially other useful information (file name, content type, etc.). Then just return an IList of those. Something like this:
Since your method name implies that you want to return even more information, you could create more DTO classes and build them together to create a “member” object. Something like this: