2014-09-03 58 views
0

我正在使用web api 2.2 odata v4.0。我有一个控制器有3种方法。例如GetA(),GetB()GetC()
我应该使用哪些代码,以便我可以从url调用单个方法?
另外,我怎样才能调用方法GetA()? - 因为Get()是在ODataController中调用的默认方法。如何在OData中的控制器中调用不同的方法

我使用的代码,

ODataRoute route = config.Routes.MapODataServiceRoute("odata", "odata",GetModel()); 
route.MapODataRouteAttributes(config); // This line threw an error sowing route does not have the method 
MapODataRouteAttributes() 

请给我建议的解决方案。

感谢

回答

相关问题