Last post Aug 07, 2014 05:30 AM by Ali Soleimani
Jul 03, 2014 10:36 AM|Ali Soleimani|LINK
It seems that there is a design issue in actions/functions implementation in new OData4 WebApi.
I have followed http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/odata-actions-and-functions tutorial. Why
we should specify namespace for actions (otherwise namespace will be "Default")? and call actions like "http://localhost/Products(1)/ProductService.Rate". suppose
we have another entity like Customer and have an action/function named GetBalance on it, service call would be "http://localhost/Customers(1)/ProductService.GetBalance" because namespace was
set on EDM.
In old WCF tutorial "http://blogs.msdn.com/b/odatateam/archive/2012/04/10/actions-in-wcf-data-services-part-1-service-author-code.aspx" there
is no namespace e.g. http://localhost:15238/MoviesService.svc/Movies(1)/Rate
Jul 06, 2014 02:29 AM|damienBod|LINK
This is an issue for me as well, the namespace definition should be optional, it would be better if actions and functions didn't require a namespace in the URL. I haven't found a workaround for this. Maybe you could create a change request and see what the
OData team say.
Aug 07, 2014 05:30 AM|Ali Soleimani|LINK
I found solution, there is project sample here: https://webapplicationplayground.codeplex.com/SourceControl/latest#WebApplicationPlayground/App_Start/WebApiConfig.cs