a C# ASP.NET Webform site using WebAPI
I have a petapoco class that has 50 properties on it, but for certain WebAPI methods I would like to filter what properties are serialized and sent to the client in the HttpResponseMessage (to reduce the payload).
For Example let say I have the following class properties in a class:
ID, FirstName, LastName, Address, City, State, Zip, DOB
I need some WebApi methods to serialize every property, but maybe another method I only want to return
ID, FirstName, LastName
Is there a built in way to handle this? If not, what's the best way to build out something to handle this?
Edit: I'm looking for a way to do this without modifying the class