public IHttpActionResult Get(Agent agent = null) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (agent == null) { return(BadRequest("Please provide an agent object as a parameter.")); } var person = _agentRepository.GetPerson(agent); return(Ok(person)); }