I'am getting crazy here. I tried a lot of different approaches that I found through out the web. However cannot seem to get this work. Here is the last thing I tried.
modelBuilder.EntitySet<User>("Users").EntityType.Action("IsEmailAvailable")
.Returns<bool>()
.Parameter<string>("email");
I configure my entity like this.
[HttpPost]
public bool IsEmailAvailable(ODataActionParameters parameters)
{
return true;
}
And this is the action in my controller.
When I do something like
I gets the entites as expected. However if I do
I got the error:
Message: "The OData path is invalid.", ExceptionMessage: "Invalid action detected. 'IsEmailAvaliable' is not an action that can bind to 'Collection([App.Models.Models.User Nullable=False])'.", ExceptionType: "Microsoft.Data.OData.ODataException", StackTrace: " at System.Web.Http.OData.Routing.DefaultODataPathHandler.ParseAtEntityCollection(IEdmModel model, ODataPathSegment previous, IEdmType previousEdmType, String segment) at System.Web.Http.OData.Routing.DefaultODataPathHandler.ParseAtCollection(IEdmModel model, ODataPathSegment previous, IEdmType previousEdmType, String segment) at System.Web.Http.OData.Routing.DefaultODataPathHandler.ParseNextSegment(IEdmModel model, ODataPathSegment previous, IEdmType previousEdmType, String segment) at System.Web.Http.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model, String odataPath) at System.Web.Http.OData.Routing.ODataPathRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, String parameterName, IDictionary`2 values, HttpRouteDirection routeDirection)"