Is there a way to ignore class properties without using annotations
<p>Following is the api call that return the Agent object</p>

<pre><code>[Route("GetAgentById")]
    public Agent GetAgentById(int id)
    {
        //Restrict Class fields
        return new Agent(id);
    }
</code></pre>

<p>Agent class have a lot of fields (Let say 100 fields)</p>

<pre><code> public class Agent
  {       
    public int AgentId { get; set; }
    public string AgentName { get; set; }
    public bool IsAssigned { get; set; }
    public bool IsLoggedIn { get; set; }
    ......
    ......
    public Agent() { }
 }
</code></pre>

<p>Is there a way to ignore class properties without using annotations. I just want to return some of the fields of agent object before returning the agent object from api call. Is there any way to doing this</p>