Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. I have a JSON where I do not yet know what concrete parameters it could contain. Without this I cannot use the annotations that would do the serialization & de-serialization out of the box.
I like OData and I was particularly pleased to its adoption by the ASP.NET Web API. I've created a few services for internal applications to consume, but never for public consumption. The primary reason is that the open nature of OData seems to make it very hard to make 'safe' against abuse. Most specifically, I'm worried that given the power to run arbitrary queries, a user could express a complex query which stresses the operational system to the point where the experience is bad for all other users.
In a WebApi controller, an OData endpoint is exposed as follows: / public class OrderController. I'm using the latest ASP.Net WebAPI Nightly builds (dated 2013-01-16). I have a simple EF database first model at the moment that has two entities - Patients and Visits. Each patient can have many visits. I'd like to be able to query for my list of patients and have the visits entities for each patient returned inline. I know that WebAPI's OData implementation doesn't yet support $expand. I'm hoping that just means that optional client-controlled expansion is not supported and that I can force expansion server-side.
At the moment I'm not getting any of the visits inline. For example, my PatientController's(.
) Adapt Microsoft.AspNet.OData.Shared to use interface layer. Add complex return type to SelectControllerResult. Abstract the creation of action mapping. Move Http method definitions to a common enum. Remove reference to ODataMediaTypeFormatter in resource files. Modify resource loading to work on NetCore and NetFx.
Move code from src Microsoft.AspNet.OData.Shared Common Common to src Microsoft.AspNet.OData.Shared Common. No other changes are includes in this commit in order to simplify history. The code does not compile in this change. Showing 91 changed files with 1,411 additions and 1,078 deletions.