title: automatically expand the result of an odata function
body: <p>I defined an odata function to mimic $search which is not supported yet in the recent core release. I want to return the core entity plus an expanded entity which would translate into a js object on each Person in the returned json values array. </p>
  
  <p>I tried <code>odata/People/MyNS.Find(text='john', orderby='CreatedOn')?$expand=CurrentWork</code> where CurrentWork is on People, but that did not work.</p>
  
  <p>Thoughts on how to do this?</p>
  
  <pre><code>  // my controller code for the function
    [HttpGet]
    public ActionResult&lt;ICollection&lt;People&gt;&gt; Find([FromODataUri] string text,
          [FromODataUri] string orderBy)
          {
              if (text == null || text.Length == 0)
                  return Get().ToList();
              if (orderBy == null || orderBy.Length == 0)
                  orderBy = "CreatedOn";
              return _db.People
                  .Where(p =&gt; p.FirstName.Contains(text)
                      || p.LastName.Contains(text)
                      || p.Nickname.Contains(text))
                  .OrderBy(orderBy)
                  .Take(5000)
                  .ToList();
          }
  </code></pre>
  
  <p>Regular expansion of CurrentWork in a non-function works fine e.g. <code>odata/People?$expand=CurrentWork</code>.</p>