Serializing a derived class

D

deja

hi,

I have a web service that builds an arraylist of objects. These objects
are derived classes of a base class with a few extra fields for help
with processing. But when I return the objects I only want to return
the base class implementation i.e

public class ServiceObject : BaseObject
{
public string helper1;
public string helper2;
public string helper3;
}

When the arraylist is returned, I want the client to see a bunch of
BaseObject objects NOT a bunch of ServiceObject objects. What is the
easiest way of doing this? I thought I could probably use some
serialization instructions but I'm not 100% sure on how to do it.

thanks
Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top