سؤال

The excellent sample code: Support Composite Key in ASP.NET Web API OData illustrates how to create routing conventions to make WebApi OData work with composite keys.

However it is using ODataController (as one of the unanswered discussions on the sample code mentions) which I presume has many downsides (which I am yet to fully uncover)... has anyone created an example using the benefits of EntitySetController?

هل كانت مفيدة؟

المحلول

Going forward the recommended approach is to directly derive from ODataController. Visual Studio 2013 provides scaffolding for creating OData services based on ODataController. This has been found to be a much more flexible model than deriving from EntitySetController. You get complete control over what is done in your actions.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top