My web api is returning a set of objects which are differ from the Domain object. Forexample, I my domain has an Employee class but I don't want to expose all the members of the Employee class in my api so I created another class called EmployeeApiModel.
Now my WebApi is returning a List of EmployeeApiModel but I want to be able to specify the name to which it should serialize to. That is instead of <EmployeeApiModel>
tag in the xml, I want to get <Employee>
but without changing the fact that the underlying class which is being serialized is EmployeeApiModel.
How can I achieve this?