OData unbound function return type references entity
<p>I would like to implement geosearch functionality for different entities. I have a generic result class, which contains the distance from the given coordinates, and a reference to the entity.</p>

<pre><code>public class GeoSearchResult&lt;T&gt; : IGeoSearchResult where T : class
{
    public T Row { get; set; }
    public double? Distance { get; set; }
}
</code></pre>

<p>I configured the function with the following code:</p>

<pre><code>var function = builder.Function("FooGeoSearch");
        function.Parameter&lt;double&gt;("lon");
        function.Parameter&lt;double&gt;("lat");
        function.Parameter&lt;double&gt;("radiusInMiles");
        function.ReturnsCollection&lt;GeoSearchResult&lt;Foo&gt;&gt;();
</code></pre>

<p>It throws the following exception when I try to run it:
The complex type '.GeoSearchResult`1Foo' refers to the entity type 'Foo' through the property 'Row'.</p>

<p>Is there a workaround?</p>