Multiple Get[NavigationProperty] methods on controller

Topics: ASP.NET Web API
Sep 24, 2012 at 2:04 PM

Hi,

I'm using the OData stuff to make an OData service. This all works impressively easy. Great work on that!

When working on a model I use, I discovered that somehow, when having 2 GetRelatedList() methods which are navigation properties, the framework isn't able to determine which of the methods to pick, and it results in an InvalidOperationException.

What am I doing wrong here? Commenting out 1 of the 2 methods fixes the issue (for 1 method, obviously)

Regards, Matthijs

Coordinator
Sep 24, 2012 at 6:09 PM

I assume you are using the ODataActionSelector from the sample application to handle the navigation properties. The action selection logic in the sample is currently very simplistic and does not handle method overloading semantics.

Could you please share with us the method signatures for the GetRelatedList() methods? What kind of method overloading semantics are you expecting?

Thanks.

Daniel Roth


Sep 24, 2012 at 6:51 PM

Thanks for your reaction. I think I miss something. (The action selector thing)
Will look into it tomorrow and reply back to you.

Sep 25, 2012 at 8:43 AM
I feel incredibly stupid: Adding the action selector thing fixes my issues. Thanks for the hint! :)


On Mon, Sep 24, 2012 at 7:50 PM, Matthijs ter Woord <matthijsterwoord@gmail.com> wrote:

Thanks for your reaction. I think I miss something. (The action selector thing)
Will look into it tomorrow and reply back to you.